{
    "schemes": ["https"],
    "swagger": "2.0",
    "info": {
        "description": "ProWorkflow Management API - REST API for managing projects, companies, contacts, invoices, quotes, and related business data",
        "title": "ProWorkflow API",
        "termsOfService": "https://www.proworkflow.com/terms",
        "contact": {
            "name": "API Support",
            "url": "https://www.proworkflow.com/support",
            "email": "support@proworkflow.com"
        },
        "license": {
            "name": "Proprietary",
            "url": "https://www.proworkflow.com/license"
        },
        "version": "4.0"
    },
    "host": "api.proworkflow.com",
    "basePath": "/api/v4",
    "paths": {
        "/companies": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Companies based on the filters specified. The fields parameter allows you to choose which data fields to return for each Company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Companies",
                "parameters": [
                    {
                        "type": "string",
                        "default": "code,name,type",
                        "description": "Comma-separated list of fields to return. Available fields: \u003cul\u003e\u003cli\u003e\u003cb\u003ecode\u003c/b\u003e - Company code identifier\u003c/li\u003e\u003cli\u003e\u003cb\u003econtacts\u003c/b\u003e - Associated contacts as a JSON array [{id, firstname, lastname}] (use contactdetails field or query param to include email, phone, image)\u003c/li\u003e\u003cli\u003e\u003cb\u003econtactdetails\u003c/b\u003e - Alias for contacts field with email, phone, and image included\u003c/li\u003e\u003cli\u003e\u003cb\u003eemail\u003c/b\u003e - Primary email address\u003c/li\u003e\u003cli\u003e\u003cb\u003efax\u003c/b\u003e - Fax number\u003c/li\u003e\u003cli\u003e\u003cb\u003eimage\u003c/b\u003e - Company logo/image URL\u003c/li\u003e\u003cli\u003e\u003cb\u003elastmodifiedutc\u003c/b\u003e - Last modified date in ISO8601 format (UTC)\u003c/li\u003e\u003cli\u003e\u003cb\u003emaincompanylocationid\u003c/b\u003e - ID of the primary company location\u003c/li\u003e\u003cli\u003e\u003cb\u003ename\u003c/b\u003e - Company name\u003c/li\u003e\u003cli\u003e\u003cb\u003ephone\u003c/b\u003e - Primary phone number\u003c/li\u003e\u003cli\u003e\u003cb\u003etags\u003c/b\u003e - Company tags as a JSON array [{id, name, color}]\u003c/li\u003e\u003cli\u003e\u003cb\u003etype\u003c/b\u003e - Company type (client, contractor, staff, other)\u003c/li\u003e\u003cli\u003e\u003cb\u003ewebsite\u003c/b\u003e - Company website URL\u003c/li\u003e\u003c/ul\u003e",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Return contact details (email, image, phone)",
                        "name": "contactdetails",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include the company's locations array in each result",
                        "name": "includelocations",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use name, code, email, or q+qfields instead. Search by name or code. Use ! for negation.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use q+qfields instead. Search by name. Use ! for negation.",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use code or q+qfields instead. Search by code. Use ! for negation.",
                        "name": "searchcode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use email or q+qfields instead. Search by email. Use ! for negation.",
                        "name": "searchemail",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact name match",
                        "name": "name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact code match",
                        "name": "code",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact email match",
                        "name": "email",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Fuzzy search term (use with qfields to restrict fields searched)",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "name",
                            "code",
                            "email"
                        ],
                        "type": "string",
                        "description": "Comma-separated fields to fuzzy search",
                        "name": "qfields",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "client",
                            "contractor",
                            "other",
                            "staff"
                        ],
                        "type": "string",
                        "description": "Company Type. \u003cul\u003e\u003cli\u003e\u003cb\u003eclient\u003c/b\u003e - Client Companies\u003c/li\u003e\u003cli\u003e\u003cb\u003econtractor\u003c/b\u003e - Contractor Companies\u003c/li\u003e\u003cli\u003e\u003cb\u003eother\u003c/b\u003e - Other Companies\u003c/li\u003e\u003cli\u003e\u003cb\u003estaff\u003c/b\u003e - Staff Companies\u003c/li\u003e\u003c/ul\u003e",
                        "name": "type",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag ID or List of Tag IDs. \u003cul\u003e\u003cli\u003e\u003cb\u003etagid/s\u003c/b\u003e - Companies with at least one of the specified Tag ID/s\u003cbr\u003eExample: 1,2,3\u003c/li\u003e\u003c/ul\u003e",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only). \u003cul\u003e\u003cli\u003e\u003cb\u003edivisionid\u003c/b\u003e - Companies in specified Division\u003cbr\u003eExample: 1\u003c/li\u003e\u003c/ul\u003e",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Companies added/edited on or after this date (UTC time). \u003cul\u003e\u003cli\u003e\u003cb\u003eSpecific date \u0026 time\u003c/b\u003e - Date in ISO8601 (yyyy-mm-ddThh:mm) format\u003cbr\u003eExample: 2014-01-18T13:20\u003c/li\u003e\u003cli\u003e\u003cb\u003eXn/h/d/w/m\u003c/b\u003e - X minutes/hours/days/weeks/months ago\u003cbr\u003eExample: 12h\u003c/li\u003e\u003c/ul\u003e",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Companies added/edited on or before this date (UTC time). \u003cul\u003e\u003cli\u003e\u003cb\u003eSpecific date \u0026 time\u003c/b\u003e - Date in ISO8601 (yyyy-mm-ddThh:mm) format\u003cbr\u003eExample: 2014-01-18T13:20\u003c/li\u003e\u003cli\u003e\u003cb\u003eXn/h/d/w/m\u003c/b\u003e - X minutes/hours/days/weeks/months ago\u003cbr\u003eExample: 12h\u003c/li\u003e\u003c/ul\u003e",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Companies with ID less than or equal to this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Companies with ID greater than or equal to this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Company IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "code"
                        ],
                        "type": "string",
                        "default": "name",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more companies. Can accept a single company object or an array of companies in the 'companies' field.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Add Company/Companies",
                "parameters": [
                    {
                        "description": "Company data",
                        "name": "company",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateCompanyPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/client": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Client Companies based on the specified filters. Equivalent to GET /companies with type=client.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Client Companies",
                "parameters": [
                    {
                        "type": "string",
                        "default": "code,name,type",
                        "description": "Comma-separated list of fields to return",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Return contact details (email, image, phone)",
                        "name": "contactdetails",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search string. Use ! for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by name. Use ! for negation",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by code. Use ! for negation",
                        "name": "searchcode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by email. Use ! for negation",
                        "name": "searchemail",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag ID or comma-separated list of Tag IDs",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "default": "false",
                        "description": "Pending status",
                        "name": "pending",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified from date in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified to date in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter companies with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter companies with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Company IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "code"
                        ],
                        "type": "string",
                        "default": "name",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/contractor": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Contractor Companies based on the specified filters. Equivalent to GET /companies with type=contractor.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Contractor Companies",
                "parameters": [
                    {
                        "type": "string",
                        "default": "code,name,type",
                        "description": "Comma-separated list of fields to return",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Return contact details (email, image, phone)",
                        "name": "contactdetails",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use name, code, email, or q+qfields instead. Search by name or code. Use ! for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use q+qfields instead. Search by name. Use ! for negation",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use code or q+qfields instead. Search by code. Use ! for negation",
                        "name": "searchcode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use email or q+qfields instead. Search by email. Use ! for negation",
                        "name": "searchemail",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact name match",
                        "name": "name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact code match",
                        "name": "code",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact email match",
                        "name": "email",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Fuzzy search term (use with qfields to restrict fields searched)",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "name",
                            "code",
                            "email"
                        ],
                        "type": "string",
                        "description": "Comma-separated fields to fuzzy search",
                        "name": "qfields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag ID or comma-separated list of Tag IDs",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "default": "false",
                        "description": "Pending status",
                        "name": "pending",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified from date in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified to date in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter companies with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter companies with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Company IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "code"
                        ],
                        "type": "string",
                        "default": "name",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/staff": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Staff Companies based on the specified filters. Equivalent to GET /companies with type=staff.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Staff Companies",
                "parameters": [
                    {
                        "type": "string",
                        "default": "code,name,type",
                        "description": "Comma-separated list of fields to return",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Return contact details (email, image, phone)",
                        "name": "contactdetails",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use name, code, email, or q+qfields instead. Search by name or code. Use ! for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use q+qfields instead. Search by name. Use ! for negation",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use code or q+qfields instead. Search by code. Use ! for negation",
                        "name": "searchcode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use email or q+qfields instead. Search by email. Use ! for negation",
                        "name": "searchemail",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact name match",
                        "name": "name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact code match",
                        "name": "code",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact email match",
                        "name": "email",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Fuzzy search term (use with qfields to restrict fields searched)",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "name",
                            "code",
                            "email"
                        ],
                        "type": "string",
                        "description": "Comma-separated fields to fuzzy search",
                        "name": "qfields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag ID or comma-separated list of Tag IDs",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "default": "false",
                        "description": "Pending status",
                        "name": "pending",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified from date in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified to date in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter companies with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter companies with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Company IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "code"
                        ],
                        "type": "string",
                        "default": "name",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/tags": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds one or more Tags to one or more Companies.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Add Tags to Companies",
                "parameters": [
                    {
                        "description": "Company IDs and Tag IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.TagsToCompaniesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Tags from one or more Companies.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Remove Tags from Companies",
                "parameters": [
                    {
                        "description": "Company IDs and Tag IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RemoveTagsFromCompaniesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details for a single company",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyGetResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing company",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Update Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Company data",
                        "name": "company",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateCompanyPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a company (marks as deleted)",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Delete Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "default": "false",
                        "description": "Also delete company contacts",
                        "name": "deletecontacts",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}/contacts": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Contacts belonging to the specified Company. Supports the same filters as GET /contacts.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Contacts for a Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "firstname,lastname,type",
                        "description": "Comma-separated fields to return. Available fields: firstname, lastname, company, title, phone, fax, email, address, type, image, lastmodified, tags, groups, teams, roles",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by name. Use ! for negation",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by email. Use ! for negation",
                        "name": "searchemail",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag IDs (comma-separated)",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Role IDs (comma-separated)",
                        "name": "roleid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Group IDs (comma-separated)",
                        "name": "groupid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "description": "Pending status",
                        "name": "pending",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "description": "Login access filter",
                        "name": "allowlogin",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or after this date (ISO8601 or relative: 12h, 5d)",
                        "name": "lastmodifiedfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or before this date (ISO8601 or relative)",
                        "name": "lastmodifiedto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or after this date in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or before this date in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Contact IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "firstname",
                            "lastname"
                        ],
                        "type": "string",
                        "default": "lastname",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more Contacts and associates them with the specified Company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Create Contacts for a Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyContactCreatePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}/invoices": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Invoices for the specified Company. Supports the same filters as GET /invoices, scoped to the given company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Invoices for a Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "number,title,company,status,totals,projectid,invoiceddate,duedate",
                        "description": "Comma-separated fields to return",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by number or title. Use ! for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by invoice number. Use ! for negation",
                        "name": "searchnumber",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by invoice title. Use ! for negation",
                        "name": "searchtitle",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "draft",
                            "submitted",
                            "authorised",
                            "paid",
                            "voided",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Invoice status",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by taxable status",
                        "name": "taxable",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project category IDs (comma-separated)",
                        "name": "projectcategoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project manager Contact IDs (comma-separated)",
                        "name": "managerid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoiced date from (ISO8601 or relative: 12h, 5d)",
                        "name": "invoiceddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoiced date to (ISO8601 or relative)",
                        "name": "invoiceddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date from (ISO8601 or relative)",
                        "name": "duedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date to (ISO8601 or relative)",
                        "name": "duedateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Paid date from (ISO8601 or relative)",
                        "name": "paiddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Paid date to (ISO8601 or relative)",
                        "name": "paiddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total minimum",
                        "name": "grandtotalfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total maximum",
                        "name": "grandtotalto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified from in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified to in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter invoices with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter invoices with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Invoice IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "number",
                            "title",
                            "invoiceddate",
                            "duedate",
                            "companyname"
                        ],
                        "type": "string",
                        "default": "number",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}/items": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Items for a Company based on the specified filters. The fields parameter allows you to choose which data fields to return for each Item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Items for a Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "title,status,priority",
                        "description": "Comma-separated fields to return. Available: title, code, number, description, status, priority, percentcomplete, position, project, company, dates, time, billable, workstageid, parentid, phasename, assignedto, tags, lastmodified, all",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "design",
                        "description": "Search by name or code. Use ! prefix for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "active",
                        "description": "Filter by status",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by priority (1=Very High to 5=Very Low)",
                        "name": "priority",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Contact IDs assigned to item, or 'me'",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "any",
                            "all"
                        ],
                        "type": "string",
                        "default": "any",
                        "description": "Mode for contacts filter",
                        "name": "contactsmode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag ID or list of Tag IDs (comma-separated)",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Items modified on or after this date (UTC). ISO8601 or relative (12h, 5d, 2w, 1m)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Items modified on or before this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Items with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Items with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Item IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "title",
                            "code",
                            "priority",
                            "startdate",
                            "duedate",
                            "completedate",
                            "status",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "title",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectItemListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}/locations": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the locations belonging to the specified Company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Locations for a Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "name,companyid",
                        "description": "Comma-separated fields to return (or 'all')",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by name. Prefix with ! for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "description": "Filter by active status",
                        "name": "active",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Locations modified on or after this date (UTC). ISO8601 or relative (12h, 5d)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Locations modified on or before this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "code"
                        ],
                        "type": "string",
                        "default": "name",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyLocationListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new location and associates it with the specified Company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Create Location for a Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Company location data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyLocationCreatePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}/locations/{locationid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a single location belonging to the specified Company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "(Company Locations) Get a Company Location",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Company Location ID",
                        "name": "locationid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyLocationGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing location belonging to the specified Company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "(Company Locations) Update a Company Location",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Company Location ID",
                        "name": "locationid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Company location update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyLocationUpdatePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-deletes a location belonging to the specified Company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "(Company Locations) Delete a Company Location",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Company Location ID",
                        "name": "locationid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}/notes": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Notes for a Company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Company Notes",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "note,creator,datecreated",
                        "description": "Comma-separated fields to return. Available fields: \u003cul\u003e\u003cli\u003e\u003cb\u003enote\u003c/b\u003e - Note content\u003c/li\u003e\u003cli\u003e\u003cb\u003ecompany\u003c/b\u003e - Company ID\u003c/li\u003e\u003cli\u003e\u003cb\u003ecreator\u003c/b\u003e - Creator ID and name (shorthand for creatorid + creatorname)\u003c/li\u003e\u003cli\u003e\u003cb\u003ecreatorid\u003c/b\u003e - Creator contact ID\u003c/li\u003e\u003cli\u003e\u003cb\u003ecreatorname\u003c/b\u003e - Creator full name\u003c/li\u003e\u003cli\u003e\u003cb\u003edatecreated\u003c/b\u003e - Date created\u003c/li\u003e\u003cli\u003e\u003cb\u003elastmodifiedutc\u003c/b\u003e - Last modified date (UTC)\u003c/li\u003e\u003c/ul\u003e",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search note content. Use ! for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Notes modified on or after this date (UTC). ISO8601 or relative (12h, 5d, 2w, 1m)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Notes modified on or before this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "datecreated"
                        ],
                        "type": "string",
                        "default": "datecreated",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "desc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyNoteListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more Notes for a specified Company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Create Company Notes",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyNoteCreatePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}/notes/{noteid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a single Note for a Company by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Company Note",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Note ID",
                        "name": "noteid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyNoteGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a Company Note.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Update Company Note",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Note ID",
                        "name": "noteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyNoteUpdatePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a Company Note.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Delete Company Note",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Note ID",
                        "name": "noteid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}/projects": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Projects for the specified Company. Supports the same filters as GET /projects, scoped to the given company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Projects for a Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "title,number,company,startdate,duedate",
                        "description": "Comma-separated fields to return",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by number or title. Use ! for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by project number. Use ! for negation",
                        "name": "searchnumber",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Project status",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Manager Contact IDs (comma-separated). Use ! for negation, or 'me'/'all'",
                        "name": "managerid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Contact IDs (comma-separated). Use ! for negation, or 'me'/'all'",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "any",
                            "all"
                        ],
                        "type": "string",
                        "default": "any",
                        "description": "Contacts filter mode",
                        "name": "contactsmode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Team IDs (comma-separated, Advanced plan only)",
                        "name": "teamid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Group IDs (comma-separated, Advanced plan only)",
                        "name": "groupid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Category IDs (comma-separated)",
                        "name": "categoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag IDs (comma-separated)",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Priority values 1-5 (comma-separated)",
                        "name": "priority",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Workstage IDs (comma-separated)",
                        "name": "workstageid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start date from (yyyy-mm-dd or relative: +/-Xd/w/m/y)",
                        "name": "startdatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start date to (yyyy-mm-dd or relative)",
                        "name": "startdateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date from (yyyy-mm-dd or relative)",
                        "name": "duedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date to (yyyy-mm-dd or relative)",
                        "name": "duedateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Complete date from (yyyy-mm-dd or relative)",
                        "name": "completedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Complete date to (yyyy-mm-dd or relative)",
                        "name": "completedateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified from in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified to in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter projects with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter projects with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Project IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "number",
                            "title",
                            "startdate",
                            "duedate",
                            "completedate",
                            "companyname",
                            "categoryname",
                            "priority"
                        ],
                        "type": "string",
                        "default": "number",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more Projects for a specified Company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Create Company Projects",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyProjectCreatePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}/quotes": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Quotes for the specified Company. Supports the same filters as GET /quotes, scoped to the given company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Quotes for a Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "number,title,company,status,totals,quoteddate",
                        "description": "Comma-separated fields to return",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by number or title. Use ! for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by quote number. Supports ! for negation",
                        "name": "searchnumber",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by quote title. Supports ! for negation",
                        "name": "searchtitle",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "pending",
                            "sent",
                            "accepted",
                            "addedtoproject",
                            "declined",
                            "expired",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Quote status",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "estimate",
                            "quote",
                            "all"
                        ],
                        "type": "string",
                        "description": "Quote type",
                        "name": "type",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by taxable status",
                        "name": "taxable",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project manager Contact IDs (comma-separated)",
                        "name": "managerid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project category IDs (comma-separated)",
                        "name": "projectcategoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quoted date from (ISO8601 or relative: 12h, 5d)",
                        "name": "quoteddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quoted date to (ISO8601 or relative)",
                        "name": "quoteddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Approved date from (ISO8601 or relative)",
                        "name": "approveddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Approved date to (ISO8601 or relative)",
                        "name": "approveddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Valid to date from (ISO8601 or relative)",
                        "name": "validtodatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Valid to date to (ISO8601 or relative)",
                        "name": "validtodateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total minimum",
                        "name": "grandtotalfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total maximum",
                        "name": "grandtotalto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "company",
                            "project",
                            "status",
                            "day",
                            "week",
                            "month",
                            "year"
                        ],
                        "type": "string",
                        "description": "Group results by",
                        "name": "subtotals",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "quoted",
                            "approved"
                        ],
                        "type": "string",
                        "description": "Date field for subtotals grouping",
                        "name": "subtotalsdateoption",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified from in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified to in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter quotes with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter quotes with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Quote IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "number",
                            "title",
                            "quoteddate",
                            "validtodate",
                            "companyname"
                        ],
                        "type": "string",
                        "default": "number",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuoteListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}/summary": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a summary of Contacts, Invoices, Projects, Quotes and Phases for the specified Company in a single request.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Company Summary",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "all",
                        "example": "contacts,projects",
                        "description": "Comma-separated data types to include, or 'all'",
                        "name": "types",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "default": "false",
                        "description": "Return total result count per section (useful with pagination)",
                        "name": "includetotals",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 10,
                        "description": "Page size per section (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanySummaryResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}/tags": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of tags linked to the specified Company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Tags for a Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "name,color",
                        "description": "Comma-separated fields to return. Available fields: \u003cul\u003e\u003cli\u003e\u003cb\u003ename\u003c/b\u003e - Tag name\u003c/li\u003e\u003cli\u003e\u003cb\u003ecolor\u003c/b\u003e - Tag color (hex)\u003c/li\u003e\u003cli\u003e\u003cb\u003esortorder\u003c/b\u003e - Display sort order\u003c/li\u003e\u003cli\u003e\u003cb\u003elastmodifiedutc\u003c/b\u003e - Last modified date (UTC)\u003c/li\u003e\u003c/ul\u003e",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by tag name. Use ! for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tags modified on or after this date (UTC). ISO8601 or relative (12h, 5d, 2w, 1m)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tags modified on or before this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "name",
                            "sortorder",
                            "lastmodifiedutc"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyTagListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates the tags linked to a Company.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Update Company Tags",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CompanyTagUpdatePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/companies/{companyid}/time": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Time Records for the specified Company. No default date range is applied — all time for the company is returned unless trackedfrom/trackedto are specified.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "companies"
                ],
                "summary": "Get Time Records for a Company",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "contact,item,dates,timetracked",
                        "description": "Comma-separated fields to return. Available: contact, item, project, company, dates, timetracked, notes, billable, lastmodified",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Contact filter: contact IDs (comma-separated), 'me', or 'all'",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Item IDs (comma-separated)",
                        "name": "itemid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project Category IDs (comma-separated)",
                        "name": "categoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "-6d",
                        "description": "Time tracked on or after this date. Accepts yyyy-mm-dd or relative: -6d, -1w",
                        "name": "trackedfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "+0d",
                        "description": "Time tracked on or before this date. Accepts yyyy-mm-dd or relative: +0d",
                        "name": "trackedto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "billable",
                            "nonbillable",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Billable filter",
                        "name": "billable",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Filter by item activeworkstate",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by notes. Use ! for negation",
                        "name": "searchnotes",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by item name. Use ! for negation",
                        "name": "searchitem",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or after this date in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or before this date in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Time Record IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "date",
                            "projectid",
                            "itemid"
                        ],
                        "type": "string",
                        "default": "id",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TimeListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "View Contacts. Returns a list of Contacts based on the filters specified.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Contacts",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,company,type",
                        "description": "Comma-separated list of fields to return. Available fields: \u003cul\u003e\u003cli\u003e\u003cb\u003eaddress\u003c/b\u003e - Postal address (computed: combines address1, address2, address3 into a single string)\u003c/li\u003e\u003cli\u003e\u003cb\u003ecompany\u003c/b\u003e - Associated company ID and name\u003c/li\u003e\u003cli\u003e\u003cb\u003eimage\u003c/b\u003e - Contact profile image URL\u003c/li\u003e\u003cli\u003e\u003cb\u003elastmodified\u003c/b\u003e - Last modified date in ISO8601 format (UTC)\u003c/li\u003e\u003cli\u003e\u003cb\u003ename\u003c/b\u003e - Contact full name (firstname + lastname)\u003c/li\u003e\u003cli\u003e\u003cb\u003enotes\u003c/b\u003e - Contact notes as a JSON array [{id, content, date, authorid, authorname}]\u003c/li\u003e\u003cli\u003e\u003cb\u003epayrate\u003c/b\u003e - Pay rate, pay rate multiplier, and default hourly rate ID\u003c/li\u003e\u003cli\u003e\u003cb\u003eroles\u003c/b\u003e - Contact roles as a JSON array [{id, name, color}]\u003c/li\u003e\u003cli\u003e\u003cb\u003estatus\u003c/b\u003e - Contact status (active, inactive)\u003c/li\u003e\u003cli\u003e\u003cb\u003etimezone\u003c/b\u003e - IANA timezone identifier\u003c/li\u003e\u003cli\u003e\u003cb\u003etype\u003c/b\u003e - Contact type (client, contractor, staff, other)\u003c/li\u003e\u003c/ul\u003e",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use q+qfields instead. Search by name. Use ! for negation.",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use email or q+qfields instead. Search by email. Use ! for negation.",
                        "name": "searchemail",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact name match (firstname + lastname)",
                        "name": "name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact email match",
                        "name": "email",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Fuzzy search term (use with qfields to restrict fields searched)",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "name",
                            "email"
                        ],
                        "type": "string",
                        "description": "Comma-separated fields to fuzzy search",
                        "name": "qfields",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "client",
                            "contractor",
                            "staff",
                            "other"
                        ],
                        "type": "string",
                        "description": "Contact Type. \u003cul\u003e\u003cli\u003e\u003cb\u003eclient\u003c/b\u003e - Client Contacts\u003c/li\u003e\u003cli\u003e\u003cb\u003econtractor\u003c/b\u003e - Contractor Contacts\u003c/li\u003e\u003cli\u003e\u003cb\u003eother\u003c/b\u003e - Other Contacts\u003c/li\u003e\u003cli\u003e\u003cb\u003estaff\u003c/b\u003e - Staff Contacts\u003c/li\u003e\u003c/ul\u003e",
                        "name": "type",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag ID or List of Tag IDs. \u003cul\u003e\u003cli\u003e\u003cb\u003etagid/s\u003c/b\u003e - Contacts with at least one of the specified Tag ID/s\u003cbr\u003eExample: 1,2,3\u003c/li\u003e\u003c/ul\u003e",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Role ID or List of Role IDs. \u003cul\u003e\u003cli\u003e\u003cb\u003eroleid/s\u003c/b\u003e - Contacts with at least one of the specified Role ID/s\u003cbr\u003eExample: 1,2,3\u003c/li\u003e\u003c/ul\u003e",
                        "name": "roleid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "Group ID or List of Group IDs (comma-separated). Contacts with at least one of the specified Group IDs",
                        "name": "groupid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "default": "false",
                        "description": "Pending status. \u003cul\u003e\u003cli\u003e\u003cb\u003etrue\u003c/b\u003e - Pending Contacts\u003c/li\u003e\u003cli\u003e\u003cb\u003efalse\u003c/b\u003e - Active Contacts\u003c/li\u003e\u003c/ul\u003e",
                        "name": "pending",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "description": "Login status. \u003cul\u003e\u003cli\u003e\u003cb\u003etrue\u003c/b\u003e - Contacts with Login Access\u003c/li\u003e\u003cli\u003e\u003cb\u003efalse\u003c/b\u003e - Contacts without Login Access\u003c/li\u003e\u003c/ul\u003e",
                        "name": "allowlogin",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only). \u003cul\u003e\u003cli\u003e\u003cb\u003edivisionid\u003c/b\u003e - Contacts in specified Division\u003cbr\u003eExample: 1\u003c/li\u003e\u003c/ul\u003e",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Company ID. \u003cul\u003e\u003cli\u003e\u003cb\u003ecompanyid\u003c/b\u003e - Contacts in specified Company\u003cbr\u003eExample: 1\u003c/li\u003e\u003c/ul\u003e",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Contacts added/edited on or after this date (UTC time). \u003cul\u003e\u003cli\u003e\u003cb\u003eSpecific date \u0026 time\u003c/b\u003e - Date in ISO8601 (yyyy-mm-ddThh:mm) format\u003cbr\u003eExample: 2014-01-18T13:20\u003c/li\u003e\u003cli\u003e\u003cb\u003eXn/h/d/w/m\u003c/b\u003e - X minutes/hours/days/weeks/months ago\u003cbr\u003eExample: 12h\u003c/li\u003e\u003c/ul\u003e",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Contacts added/edited on or before this date (UTC time). \u003cul\u003e\u003cli\u003e\u003cb\u003eSpecific date \u0026 time\u003c/b\u003e - Date in ISO8601 (yyyy-mm-ddThh:mm) format\u003cbr\u003eExample: 2014-01-18T13:20\u003c/li\u003e\u003cli\u003e\u003cb\u003eXn/h/d/w/m\u003c/b\u003e - X minutes/hours/days/weeks/months ago\u003cbr\u003eExample: 12h\u003c/li\u003e\u003c/ul\u003e",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Contacts with ID greater than or equal to this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Contacts with ID less than or equal to this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3,4",
                        "description": "List of Contact IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "firstname",
                            "lastname"
                        ],
                        "type": "string",
                        "default": "firstname",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Create one or more new contacts",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Create Contacts",
                "parameters": [
                    {
                        "description": "Contact data",
                        "name": "contact",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateContactPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/client": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Client Contacts. Supports the same filters as GET /contacts, scoped to type=client.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Client Contacts",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,company,type",
                        "description": "Comma-separated fields to return. Available: id, name, company, type, email, phone, fax, address, title, image, lastmodified, logindetails, roles, tags, teams, groups, notes",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use q+qfields instead. Search by name. Use ! for negation",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use email or q+qfields instead. Search by email. Use ! for negation",
                        "name": "searchemail",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact name match (firstname + lastname)",
                        "name": "name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact email match",
                        "name": "email",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Fuzzy search term (use with qfields to restrict fields searched)",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "name",
                            "email"
                        ],
                        "type": "string",
                        "description": "Comma-separated fields to fuzzy search",
                        "name": "qfields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag IDs (comma-separated)",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Role IDs (comma-separated)",
                        "name": "roleid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Group IDs (comma-separated)",
                        "name": "groupid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "description": "Pending status",
                        "name": "pending",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "description": "Login access filter",
                        "name": "allowlogin",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or after this date in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or before this date in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Records with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Records with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Contact IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "firstname",
                            "lastname"
                        ],
                        "type": "string",
                        "default": "firstname",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/contractor": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Contractor Contacts. Supports the same filters as GET /contacts, scoped to type=contractor.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Contractor Contacts",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,company,type",
                        "description": "Comma-separated fields to return. Available: id, name, company, type, email, phone, fax, address, title, image, lastmodified, logindetails, roles, tags, teams, groups, notes",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use q+qfields instead. Search by name. Use ! for negation",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use email or q+qfields instead. Search by email. Use ! for negation",
                        "name": "searchemail",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact name match (firstname + lastname)",
                        "name": "name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact email match",
                        "name": "email",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Fuzzy search term (use with qfields to restrict fields searched)",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "name",
                            "email"
                        ],
                        "type": "string",
                        "description": "Comma-separated fields to fuzzy search",
                        "name": "qfields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag IDs (comma-separated)",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Role IDs (comma-separated)",
                        "name": "roleid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Group IDs (comma-separated)",
                        "name": "groupid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "description": "Pending status",
                        "name": "pending",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "description": "Login access filter",
                        "name": "allowlogin",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or after this date in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or before this date in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Records with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Records with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Contact IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "firstname",
                            "lastname"
                        ],
                        "type": "string",
                        "default": "firstname",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/groups": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds one or more Groups to one or more Contacts.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Add Groups to Contacts",
                "parameters": [
                    {
                        "description": "Contact IDs and Group IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.GroupsToContactsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Groups from one or more Contacts.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Remove Groups from Contacts",
                "parameters": [
                    {
                        "description": "Contact IDs and Group IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.GroupsToContactsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/roles": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Assigns one or more Roles to one or more Staff Contacts.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Assign Roles to Contacts",
                "parameters": [
                    {
                        "description": "Contact IDs and Role IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RolesToContactsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Roles from one or more Staff Contacts.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Remove Roles from Contacts",
                "parameters": [
                    {
                        "description": "Contact IDs and Role IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RolesToContactsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/roles/contacts": {
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Contacts from one or more Roles.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Remove Contacts from Roles",
                "parameters": [
                    {
                        "description": "Role IDs and Contact IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RemoveContactsFromRolesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/staff": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Staff Contacts. Supports the same filters as GET /contacts, scoped to type=staff.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Staff Contacts",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,company,type",
                        "description": "Comma-separated fields to return. Available: id, name, company, type, email, phone, fax, address, title, image, lastmodified, logindetails, roles, tags, teams, groups, notes",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use q+qfields instead. Search by name. Use ! for negation",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use email or q+qfields instead. Search by email. Use ! for negation",
                        "name": "searchemail",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact name match (firstname + lastname)",
                        "name": "name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact email match",
                        "name": "email",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Fuzzy search term (use with qfields to restrict fields searched)",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "name",
                            "email"
                        ],
                        "type": "string",
                        "description": "Comma-separated fields to fuzzy search",
                        "name": "qfields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag IDs (comma-separated)",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Role IDs (comma-separated)",
                        "name": "roleid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Group IDs (comma-separated)",
                        "name": "groupid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "description": "Pending status",
                        "name": "pending",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "description": "Login access filter",
                        "name": "allowlogin",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Company ID",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or after this date in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or before this date in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Records with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Records with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Contact IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "firstname",
                            "lastname"
                        ],
                        "type": "string",
                        "default": "firstname",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/tags": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds one or more Tags to one or more Contacts.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Add Tags to Contacts",
                "parameters": [
                    {
                        "description": "Contact IDs and Tag IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.TagsToContactsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Tags from one or more Contacts.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Remove Tags from Contacts",
                "parameters": [
                    {
                        "description": "Contact IDs and Tag IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RemoveTagsFromContactsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/{contactid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Contact",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactDetailResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Update Contact",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Contact data to update",
                        "name": "contact",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateContactPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Delete Contact",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/{contactid}/groups": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Teams \u0026amp; Groups for a Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Contact Teams \u0026 Groups",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactGroupsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates the groups assigned to a Staff Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Update Contact Groups",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Group IDs",
                        "name": "groups",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateContactGroupsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/{contactid}/items": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Items (Tasks) assigned to the specified Contact. Supports the same filters as GET /items, scoped to the given contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Items for a Contact",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "title,status,priority",
                        "description": "Comma-separated fields to return. Available: title, code, number, description, status, priority, percentcomplete, position, project, company, dates, time, billable, workstageid, parentid, phasename, assignedto, tags, lastmodified",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by name or code. Use ! for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by name. Use ! for negation",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by description. Use ! for negation",
                        "name": "searchdescription",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by code. Use ! for negation",
                        "name": "searchcode",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "active",
                        "description": "Item status",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Priority values 1-5 (comma-separated)",
                        "name": "priority",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Company IDs (comma-separated)",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Additional contact filter (comma-separated IDs, or 'me')",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "any",
                            "all"
                        ],
                        "type": "string",
                        "default": "any",
                        "description": "Mode for contacts filter",
                        "name": "contactsmode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag IDs (comma-separated)",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Work Stage ID",
                        "name": "workstageid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start date from (yyyy-mm-dd)",
                        "name": "startdatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start date to (yyyy-mm-dd)",
                        "name": "startdateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date from (yyyy-mm-dd)",
                        "name": "duedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date to (yyyy-mm-dd)",
                        "name": "duedateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Items modified on or after this date in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Items modified on or before this date in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Items with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Items with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Item IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "title",
                            "code",
                            "priority",
                            "startdate",
                            "duedate",
                            "completedate",
                            "status",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "title",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectItemListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Assigns a Contact to one or more Items (Tasks).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Assign Contact to Items",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Item IDs to assign the contact to",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AddContactItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/{contactid}/notes": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Notes for a Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Contact Notes",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactNoteListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more Notes for a Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Create Contact Notes",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Note data",
                        "name": "note",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateContactNotePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/{contactid}/notes/{noteid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a single Note for a Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Contact Note",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Note ID",
                        "name": "noteid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactNoteGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a Contact Note.\nUpdates a Contact Note.",
                "consumes": [
                    "application/json",
                    "application/json"
                ],
                "produces": [
                    "application/json",
                    "application/json"
                ],
                "tags": [
                    "contacts",
                    "contacts"
                ],
                "summary": "Update Contact Note",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Note ID",
                        "name": "noteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Note ID",
                        "name": "noteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateContactNotePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "responses": {}
            }
        },
        "/contacts/{contactid}/permissions": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns all permissions for a Staff contact. Use GET /settings/contacts/permissions to retrieve the list of available permission IDs.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get All Permissions for a Contact",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/handlers.ContactPermissionResponse"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/{contactid}/permissions/{permissionid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a single permission entry for a Staff contact. Use GET /settings/contacts/permissions to retrieve the list of available permission IDs.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Check a Single Permission for a Contact",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Permission ID",
                        "name": "permissionid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactPermissionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/{contactid}/projects": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Projects the specified Contact is assigned to (as staff, contractor, or client). Supports the same filters as GET /projects, scoped to the given contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Projects for a Contact",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "title,number,company,startdate,duedate",
                        "description": "Comma-separated fields to return",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by number or title. Use ! for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by project number. Use ! for negation",
                        "name": "searchnumber",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Project status",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Manager Contact IDs (comma-separated). Use ! for negation, or 'me'/'all'",
                        "name": "managerid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Additional contact filter (comma-separated IDs). Use ! for negation, or 'me'/'all'",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "any",
                            "all"
                        ],
                        "type": "string",
                        "default": "any",
                        "description": "Contacts filter mode",
                        "name": "contactsmode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Team IDs (comma-separated, Advanced plan only)",
                        "name": "teamid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Group IDs (comma-separated, Advanced plan only)",
                        "name": "groupid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Category IDs (comma-separated)",
                        "name": "categoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag IDs (comma-separated)",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Priority values 1-5 (comma-separated)",
                        "name": "priority",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Workstage IDs (comma-separated)",
                        "name": "workstageid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start date from (yyyy-mm-dd or relative: +/-Xd/w/m/y)",
                        "name": "startdatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start date to (yyyy-mm-dd or relative)",
                        "name": "startdateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date from (yyyy-mm-dd or relative)",
                        "name": "duedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date to (yyyy-mm-dd or relative)",
                        "name": "duedateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Complete date from (yyyy-mm-dd or relative)",
                        "name": "completedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Complete date to (yyyy-mm-dd or relative)",
                        "name": "completedateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified from in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified to in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter projects with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter projects with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Project IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "number",
                            "title",
                            "startdate",
                            "duedate",
                            "completedate",
                            "companyname",
                            "categoryname",
                            "priority"
                        ],
                        "type": "string",
                        "default": "number",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds a Contact to one or more Projects.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Add Contact to Projects",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Project IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactProjectsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes a Contact from one or more Projects.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Remove Contact from Projects",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Project IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactProjectsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/{contactid}/roles": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of roles for a Staff Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Roles for a Staff Contact",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactRoleListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Assigns one or more Roles to a Staff Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Add Roles to a Contact",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Role IDs to assign",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactRolesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Roles from a Staff Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Remove Roles from a Contact",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Role IDs to remove",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactRolesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/{contactid}/tags": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of tags linked to the specified Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Tags for a Contact",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tags modified on or after this date (UTC). ISO8601 or relative (12h, 5d, 2w, 1m)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tags modified on or before this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactTagListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates the tags linked to a Contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Update Contact Tags",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Tag IDs",
                        "name": "tags",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateContactTagsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/contacts/{contactid}/time": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Time Records tracked by the specified Contact. No default date range is applied — all time for the contact is returned unless trackedfrom/trackedto are specified.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Time Records for a Contact",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Contact ID",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "contact,item,dates,timetracked",
                        "description": "Comma-separated fields to return. Available: contact, item, project, company, dates, timetracked, notes, billable, lastmodified",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Item IDs (comma-separated)",
                        "name": "itemid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Company IDs (comma-separated)",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project Category IDs (comma-separated)",
                        "name": "categoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "-6d",
                        "description": "Time tracked on or after this date. Accepts yyyy-mm-dd or relative: -6d, -1w",
                        "name": "trackedfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "+0d",
                        "description": "Time tracked on or before this date. Accepts yyyy-mm-dd or relative: +0d",
                        "name": "trackedto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "billable",
                            "nonbillable",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Billable filter",
                        "name": "billable",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Filter by item activeworkstate",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by notes. Use ! for negation",
                        "name": "searchnotes",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by item name. Use ! for negation",
                        "name": "searchitem",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or after this date in UTC",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or before this date in UTC",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Time Record IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "date",
                            "projectid",
                            "itemid"
                        ],
                        "type": "string",
                        "default": "id",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TimeListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/files": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Files based on the filters specified. The fields parameter allows you to choose which data fields to return for each File.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "files"
                ],
                "summary": "Get Files",
                "parameters": [
                    {
                        "type": "string",
                        "default": "name,project,item,date,size,link",
                        "description": "Comma-separated list of fields to return. Available: name, description, size, project, projectnumber, projecttitle, item (or task), itemname (or taskname), folder, foldername, contactids, date, owner, link, all",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by file name. Use ! prefix for negation.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "default": "active",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Project ID or list of Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Filter by item activeworkstate",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Alias for activeworkstate parameter.",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Item (task) ID or list of IDs (comma-separated). Alias: taskid",
                        "name": "itemid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Alias for itemid parameter.",
                        "name": "taskid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Folder ID or list of Folder IDs (comma-separated)",
                        "name": "folderid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "2024-01-18",
                        "description": "Files modified on or after this date (ISO8601 or relative: 12h, 5d, 2w, 1m)",
                        "name": "datefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "2024-01-18",
                        "description": "Files modified on or before this date (ISO8601 or relative)",
                        "name": "dateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Files with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Files with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of File IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "size",
                            "date",
                            "itemid",
                            "taskid",
                            "folderid",
                            "projectid"
                        ],
                        "type": "string",
                        "default": "name",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.FileListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/files/folders": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Custom Folders based on the specified filters. Access is scoped by the authenticated user's project membership (staff see all, clients/contractors see their linked projects only). Only returns folders of type 'custom'.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "folders"
                ],
                "summary": "Get Custom Folders",
                "parameters": [
                    {
                        "type": "string",
                        "default": "name,project",
                        "description": "Comma-separated fields to return. Available: name, description, type, size, date, owner, contacts, project, item (or task), public",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "reports",
                        "description": "Search by folder name. Use ! for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "default": "active",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Folders with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Folders with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "List of Folder IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "projectid"
                        ],
                        "type": "string",
                        "default": "name",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.FolderListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a custom folder within a project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "folders"
                ],
                "summary": "Create Custom Folder",
                "parameters": [
                    {
                        "description": "Folder data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateFolderPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/files/folders/{folderid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single Custom Folder by ID. Access is scoped by the authenticated user's project membership (staff see all, clients/contractors see their linked projects only).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "folders"
                ],
                "summary": "Get Custom Folder",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Folder ID",
                        "name": "folderid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.FolderGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing custom folder.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "folders"
                ],
                "summary": "Update Custom Folder",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Folder ID",
                        "name": "folderid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Folder update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateFolderPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Deletes a custom folder by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "folders"
                ],
                "summary": "Delete Custom Folder",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Folder ID",
                        "name": "folderid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/files/folders/{folderid}/files": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Upload a file to a Folder. Send a multipart/form-data request with the file in the \"file\" field. The folder may be a custom folder, project root, or task folder — the file is placed in the corresponding location on disk. Blocked extensions: exe, msi, ini, bin, bat, cfm, cfc, asp, aspx, php, config, vb, java, pl.",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "folders"
                ],
                "summary": "Upload File to Folder",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Folder ID",
                        "name": "folderid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "file",
                        "description": "File to upload",
                        "name": "file",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.FileUploadResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/files/{fileid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single File by ID. Access is scoped by the authenticated user's project membership.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "files"
                ],
                "summary": "Get File",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "File ID",
                        "name": "fileid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.FileGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-delete a File by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "files"
                ],
                "summary": "Delete File",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "File ID",
                        "name": "fileid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/files/{fileid}/download": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Downloads the binary content of a File by ID. Returns the raw file with Content-Type inferred from the file extension and Content-Disposition set to attachment. Note: use curl or an API client to download — Swagger UI cannot render binary responses.",
                "produces": [
                    "application/octet-stream"
                ],
                "tags": [
                    "files"
                ],
                "summary": "Download File",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "File ID",
                        "name": "fileid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File content",
                        "schema": {
                            "type": "file"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Invoices based on the filters specified. Optionally returns subtotals grouped by company, project, status, or time period. Also returns the grand totals across all returned invoices.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoices",
                "parameters": [
                    {
                        "type": "string",
                        "default": "number,title,company,status,totals,projectid,invoiceddate,duedate",
                        "description": "Comma-separated list of fields to return. Available fields: \u003cul\u003e\u003cli\u003e\u003cb\u003enumber\u003c/b\u003e - Invoice number/reference code\u003c/li\u003e\u003cli\u003e\u003cb\u003etitle\u003c/b\u003e - Invoice title\u003c/li\u003e\u003cli\u003e\u003cb\u003estatus\u003c/b\u003e - Invoice status (draft, submitted, authorised, paid, voided, deleted)\u003c/li\u003e\u003cli\u003e\u003cb\u003edescription\u003c/b\u003e - Invoice description (plain text, HTML stripped)\u003c/li\u003e\u003cli\u003e\u003cb\u003ecompany\u003c/b\u003e - Client company ID and name\u003c/li\u003e\u003cli\u003e\u003cb\u003eproject\u003c/b\u003e - Associated project IDs, titles, and numbers as a comma-delimited list\u003c/li\u003e\u003cli\u003e\u003cb\u003eprojectid\u003c/b\u003e - Associated project IDs only (comma-separated if multiple)\u003c/li\u003e\u003cli\u003e\u003cb\u003edates\u003c/b\u003e - All date fields: invoiceddate, duedate, paiddate\u003c/li\u003e\u003cli\u003e\u003cb\u003einvoiceddate\u003c/b\u003e - Invoice issue date (yyyy-mm-dd)\u003c/li\u003e\u003cli\u003e\u003cb\u003eduedate\u003c/b\u003e - Payment due date (yyyy-mm-dd)\u003c/li\u003e\u003cli\u003e\u003cb\u003epaiddate\u003c/b\u003e - Date payment was received (yyyy-mm-dd)\u003c/li\u003e\u003cli\u003e\u003cb\u003eemaileddate\u003c/b\u003e - Date invoice was emailed (yyyy-mm-dd)\u003c/li\u003e\u003cli\u003e\u003cb\u003eemailedto\u003c/b\u003e - Email address the invoice was sent to\u003c/li\u003e\u003cli\u003e\u003cb\u003eemailedtoclient\u003c/b\u003e - Whether the invoice has been emailed to the client (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003einvoicedby\u003c/b\u003e - Full name of the contact who created the invoice\u003c/li\u003e\u003cli\u003e\u003cb\u003etotals\u003c/b\u003e - Financial totals: subtotal, taxtotal, and grandtotal (all decimal, 2dp)\u003c/li\u003e\u003cli\u003e\u003cb\u003etaxable\u003c/b\u003e - Whether the invoice is taxable (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003etaxrate\u003c/b\u003e - Tax rate as a percentage (decimal, e.g. 15.0)\u003c/li\u003e\u003cli\u003e\u003cb\u003epurchaseordernumber\u003c/b\u003e - Client purchase order reference number\u003c/li\u003e\u003cli\u003e\u003cb\u003eshowcostbreakdown\u003c/b\u003e - Whether cost breakdown is displayed (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003eshowitemdescription\u003c/b\u003e - Whether item descriptions are shown (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003eshowphases\u003c/b\u003e - Whether phases are shown (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003ecustomfield\u003c/b\u003e - Custom field name and value pair\u003c/li\u003e\u003cli\u003e\u003cb\u003epaid\u003c/b\u003e - Whether the invoice has been paid (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003eactiveworkstageid\u003c/b\u003e - Active work stage ID\u003c/li\u003e\u003cli\u003e\u003cb\u003eclientcontactname\u003c/b\u003e - Client contact name on the invoice\u003c/li\u003e\u003cli\u003e\u003cb\u003einvoicetermid\u003c/b\u003e - Invoice payment term ID\u003c/li\u003e\u003cli\u003e\u003cb\u003epaymentterms\u003c/b\u003e - Payment terms text (returned together with invoicetermid)\u003c/li\u003e\u003cli\u003e\u003cb\u003epagetitle\u003c/b\u003e - Page/PDF title of the invoice\u003c/li\u003e\u003cli\u003e\u003cb\u003eaddress\u003c/b\u003e - All address fields: address1, address2, address3, city, state, zipcode, country\u003c/li\u003e\u003cli\u003e\u003cb\u003ebudget\u003c/b\u003e - Budget fields: budget, budgetTax, budgetType\u003c/li\u003e\u003cli\u003e\u003cb\u003ebillamount\u003c/b\u003e - Bill amount fields: billAmount, billAmountTax, billType\u003c/li\u003e\u003cli\u003e\u003cb\u003eestbillamount\u003c/b\u003e - Estimated bill amount (sensitive)\u003c/li\u003e\u003cli\u003e\u003cb\u003eestbillamounttax\u003c/b\u003e - Estimated bill amount including tax (sensitive)\u003c/li\u003e\u003cli\u003e\u003cb\u003eitemsdiscount\u003c/b\u003e - Items discount value (sensitive)\u003c/li\u003e\u003cli\u003e\u003cb\u003etimebillable\u003c/b\u003e - Billable time in minutes (sensitive)\u003c/li\u003e\u003cli\u003e\u003cb\u003etemplate\u003c/b\u003e - Whether this invoice is a template (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003elastmodified\u003c/b\u003e - Last modified date in ISO8601 format (UTC)\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - Returns all available scalar fields\u003c/li\u003e\u003c/ul\u003e\u003cb\u003eSub-entity fields\u003c/b\u003e (heavy — NOT included by \u003cb\u003eall\u003c/b\u003e, must be named explicitly): \u003cb\u003ephases\u003c/b\u003e - invoice phases and their line items. Use e.g. \u003ci\u003efields=all,phases\u003c/i\u003e or \u003ci\u003efields=phases\u003c/i\u003e.",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use number, title, or q+qfields instead. Search by number or title. Use ! for negation.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use number or q+qfields instead. Search by invoice number. Supports ! for negation.",
                        "name": "searchnumber",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use title or q+qfields instead. Search by invoice title. Supports ! for negation.",
                        "name": "searchtitle",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact number match",
                        "name": "number",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact title match",
                        "name": "title",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Fuzzy search term (use with qfields to restrict fields searched)",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "number",
                            "title"
                        ],
                        "type": "string",
                        "description": "Comma-separated fields to fuzzy search",
                        "name": "qfields",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "draft",
                            "submitted",
                            "authorised",
                            "paid",
                            "voided",
                            "deleted",
                            "all",
                            "unpaid"
                        ],
                        "type": "string",
                        "description": "Status (activeworkstate). Alias: activeworkstate.",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "draft",
                            "submitted",
                            "authorised",
                            "paid",
                            "voided",
                            "deleted",
                            "all",
                            "unpaid"
                        ],
                        "type": "string",
                        "description": "Alias for status.",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by taxable status",
                        "name": "taxable",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project manager Contact IDs (comma-separated)",
                        "name": "managerid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project category IDs (comma-separated)",
                        "name": "projectcategoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Company IDs (comma-separated)",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter invoices by active work stage ID",
                        "name": "workstageid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoiced date from (ISO8601 or relative: 12h, 5d, 2w, 1m)",
                        "name": "invoiceddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoiced date to (ISO8601 or relative)",
                        "name": "invoiceddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date from (ISO8601 or relative)",
                        "name": "duedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date to (ISO8601 or relative)",
                        "name": "duedateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Paid date from (ISO8601 or relative)",
                        "name": "paiddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Paid date to (ISO8601 or relative)",
                        "name": "paiddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total minimum",
                        "name": "grandtotalfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total maximum",
                        "name": "grandtotalto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "company",
                            "project",
                            "status",
                            "day",
                            "week",
                            "month",
                            "year"
                        ],
                        "type": "string",
                        "description": "Group results by. Returns subtotals per group.",
                        "name": "subtotals",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "invoiced",
                            "due",
                            "paid"
                        ],
                        "type": "string",
                        "description": "Date field for subtotals grouping",
                        "name": "subtotalsdateoption",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoices modified on or after this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoices modified on or before this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoices with ID greater than or equal to this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoices with ID less than or equal to this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Invoice IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "number",
                            "title",
                            "invoiceddate",
                            "duedate",
                            "companyname"
                        ],
                        "type": "string",
                        "default": "number",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new invoice.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Create Invoice",
                "parameters": [
                    {
                        "description": "Invoice data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateInvoicePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes one or more invoices by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Bulk Delete Invoices",
                "parameters": [
                    {
                        "description": "Invoice IDs to delete",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkDeleteInvoicesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/items": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of all invoice line items across all invoices, based on the filters specified.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoice Items",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,itemcollectionid,parentid,itemtypeid,activeworkstate,billAmount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by item name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoice ID or list of Invoice IDs (comma-separated)",
                        "name": "invoiceid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to items within a specific phase (itemcollectionid)",
                        "name": "phaseid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter by parent item ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter by item type ID",
                        "name": "itemtypeid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceItemListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates one or more invoice items by ID. All fields except ids are optional — only provided fields are updated.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Bulk Update Invoice Items",
                "parameters": [
                    {
                        "description": "Item IDs and fields to update",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkUpdateItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more invoice line items. The invoiceid must be provided in the request body.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Create Invoice Items",
                "parameters": [
                    {
                        "description": "Item data (single object or array)",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceItemCreatePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/items/{itemid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single invoice line item by ID, without requiring the invoice ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoice Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceItemGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing invoice line item by ID, without requiring the invoice ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Update Invoice Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Item update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceItemUpdatePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-deletes an invoice line item by ID, without requiring the invoice ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Delete Invoice Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/items/{itemid}/order": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Moves an invoice item before or after another item using sortorder. Provide exactly one of placeafterid or placebeforeid.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Reorder Invoice Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Order placement",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateInvoiceItemOrderRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/overdue": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns invoices that are past their due date and have not been paid (status: submitted or authorised). Supports the same field selection, sorting, and pagination as GET /invoices.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get overdue invoices",
                "parameters": [
                    {
                        "type": "string",
                        "default": "number,title,company,status,totals,projectid,invoiceddate,duedate",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by number or title. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by invoice number. Supports ! for negation.",
                        "name": "searchnumber",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by invoice title. Supports ! for negation.",
                        "name": "searchtitle",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by taxable status",
                        "name": "taxable",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project manager Contact IDs (comma-separated)",
                        "name": "managerid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project category IDs (comma-separated)",
                        "name": "projectcategoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Company IDs (comma-separated)",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoiced date from (ISO8601 or relative: 12h, 5d, 2w, 1m)",
                        "name": "invoiceddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoiced date to (ISO8601 or relative)",
                        "name": "invoiceddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date from (ISO8601 or relative)",
                        "name": "duedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total minimum",
                        "name": "grandtotalfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total maximum",
                        "name": "grandtotalto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified UTC from (ISO8601 or relative)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified UTC to (ISO8601 or relative)",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoice ID range from",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoice ID range to",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Invoice IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "number",
                            "title",
                            "invoiceddate",
                            "duedate",
                            "companyname"
                        ],
                        "type": "string",
                        "default": "duedate",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/phases": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns phases (item collections) across all invoices. Optionally filter by one or more invoice IDs.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoice Phases",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,invoiceid,parentid,billAmount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by phase name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Invoice ID or comma-separated list of Invoice IDs to filter by",
                        "name": "invoiceid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to phases with a specific parent phase ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoicePhaseListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates one or more invoice phases by ID. All fields except ids are optional.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Bulk Update Invoice Phases",
                "parameters": [
                    {
                        "description": "Phase IDs and fields to update",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkUpdatePhasesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more invoice phases (item collections). The invoiceid must be included in the request body.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Create Invoice Phases",
                "parameters": [
                    {
                        "description": "Phase data (single object or array)",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateInvoicePhasePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/phases/adjustdates": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Shifts item dates within one or more invoice phases by a number of days. Negative values shift backwards.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Bulk Adjust Invoice Phase Dates",
                "parameters": [
                    {
                        "description": "Phase IDs and day offset",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkAdjustPhaseDatesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/phases/{phaseid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single invoice phase by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoice Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoicePhaseGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing invoice phase by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Update Invoice Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Phase update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateInvoicePhasePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-deletes an invoice phase by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Delete Invoice Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/{invoiceid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "View a single Invoice. Returns detailed information including phases and line items. IMPORTANT: For Task/Staff Rate Lines, the 'rate' value is cost/hour, the 'time' value is the time in minutes.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoice",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing invoice. Only provide the fields you want to update.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Update Invoice",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Invoice update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateInvoicePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes an invoice by setting activeworkstate to 'deleted'.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Delete Invoice",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/{invoiceid}/clone": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Clones an existing invoice.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Clone Invoice",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID to clone",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Clone options",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CloneQuoteInvoiceRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/{invoiceid}/items": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of line items for an invoice. Supports field selection, filtering, sorting and pagination.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoice Items",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "id,name,itemcollectionid,parentid,itemtypeid,activeworkstate,billAmount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by item name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to items within a specific phase (itemcollectionid)",
                        "name": "phaseid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter by parent item ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter by item type ID",
                        "name": "itemtypeid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceItemListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more line items within an invoice phase.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Create Invoice Items",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Item data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceItemCreatePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/{invoiceid}/items/{itemid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single invoice line item by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoice Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceItemGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing invoice line item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Update Invoice Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Item update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceItemUpdatePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-deletes an invoice line item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Delete Invoice Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/{invoiceid}/items/{itemid}/workstages": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the workstage history for an invoice line item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoice Item Workstage History",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "enum": [
                            "setdatetime",
                            "id"
                        ],
                        "type": "string",
                        "default": "setdatetime",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "desc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ItemWorkStageHistoryListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/{invoiceid}/order": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Moves an invoice before or after another invoice using sortorder. Provide exactly one of placeafterid or placebeforeid.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Reorder Invoice",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Order placement",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateInvoiceOrderRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/{invoiceid}/phases": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of phases (item collections) for an invoice.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoice Phases",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "id,name,invoiceid,parentid,billAmount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by phase name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to phases with a specific parent phase ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoicePhaseListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more phases (item collections) within an invoice.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Create Invoice Phases",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Phase data (single object or array)",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateInvoicePhasePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/{invoiceid}/phases/{phaseid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single invoice phase (item collection) by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoice Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoicePhaseGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing invoice phase.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Update Invoice Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Phase update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateInvoicePhasePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-deletes an invoice phase and its associated items.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Delete Invoice Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/{invoiceid}/workstage": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Sets the active work stage for an invoice.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Update Invoice Work Stage",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Work stage",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateInvoiceWorkStageRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/invoices/{invoiceid}/workstages": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the workstage history for an invoice.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoice Workstage History",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Invoice ID",
                        "name": "invoiceid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "enum": [
                            "setdatetime",
                            "id"
                        ],
                        "type": "string",
                        "default": "setdatetime",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "desc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceWorkStageHistoryListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/me": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Returns details of the Contact making the request (the authenticated user). Requires JWT authentication — API key auth has no user context.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "me"
                ],
                "summary": "Get Contact Information",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MeGetResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Messages based on the filters specified. The fields parameter allows you to choose which data fields to return for each Message. IMPORTANT: We recommend using the datefrom option to return only messages added in the timeframe you require.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Get Messages",
                "parameters": [
                    {
                        "type": "string",
                        "default": "subject,content,originalmessageid,project,item,date,author,contacts,public,files",
                        "description": "Comma-separated list of fields to return. Available fields: \u003cul\u003e\u003cli\u003e\u003cb\u003esubject\u003c/b\u003e - Message subject\u003c/li\u003e\u003cli\u003e\u003cb\u003econtent\u003c/b\u003e - Full message body (HTML stripped)\u003c/li\u003e\u003cli\u003e\u003cb\u003eoriginalmessageid\u003c/b\u003e - Parent message ID (0 if this started the discussion)\u003c/li\u003e\u003cli\u003e\u003cb\u003eproject\u003c/b\u003e - Project ID, number, and title\u003c/li\u003e\u003cli\u003e\u003cb\u003eitem\u003c/b\u003e (or \u003cb\u003etask\u003c/b\u003e) - Item ID and name\u003c/li\u003e\u003cli\u003e\u003cb\u003eitemid\u003c/b\u003e (or \u003cb\u003etaskid\u003c/b\u003e) - Item ID only\u003c/li\u003e\u003cli\u003e\u003cb\u003eitemname\u003c/b\u003e (or \u003cb\u003etaskname\u003c/b\u003e) - Item name only\u003c/li\u003e\u003cli\u003e\u003cb\u003edate\u003c/b\u003e - Message date (ISO8601)\u003c/li\u003e\u003cli\u003e\u003cb\u003eauthor\u003c/b\u003e - All author fields (id, type, name, email, image)\u003c/li\u003e\u003cli\u003e\u003cb\u003eauthorid\u003c/b\u003e - Author contact ID\u003c/li\u003e\u003cli\u003e\u003cb\u003eauthortype\u003c/b\u003e - Author contact type\u003c/li\u003e\u003cli\u003e\u003cb\u003eauthorname\u003c/b\u003e - Author display name\u003c/li\u003e\u003cli\u003e\u003cb\u003eauthoremail\u003c/b\u003e - Author email address\u003c/li\u003e\u003cli\u003e\u003cb\u003eauthorimage\u003c/b\u003e - Author avatar image URL\u003c/li\u003e\u003cli\u003e\u003cb\u003econtacts\u003c/b\u003e - Recipient contact IDs\u003c/li\u003e\u003cli\u003e\u003cb\u003epublic\u003c/b\u003e - Whether message is public\u003c/li\u003e\u003cli\u003e\u003cb\u003efiles\u003c/b\u003e - File IDs and files-enabled flag\u003c/li\u003e\u003cli\u003e\u003cb\u003ereplycount\u003c/b\u003e - Number of replies\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - All fields\u003c/li\u003e\u003c/ul\u003e",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by subject. \u003cul\u003e\u003cli\u003e\u003cb\u003estring\u003c/b\u003e - Messages where subject contains string\u003c/li\u003e\u003cli\u003e\u003cb\u003e!string\u003c/b\u003e - Messages where subject does NOT contain string\u003c/li\u003e\u003c/ul\u003e",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Filter by contact. Comma-separated Contact IDs, 'me', or 'all'",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "default": "active",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Project ID or list of Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Filter by item activeworkstate",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Alias for activeworkstate parameter.",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Item (task) ID or list of IDs (comma-separated). Alias: taskid",
                        "name": "itemid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Alias for itemid parameter.",
                        "name": "taskid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Original Message ID - returns messages in the discussion started by this message",
                        "name": "originalmessageid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "2024-01-18",
                        "description": "Messages added on or after this date (ISO8601 or relative: 12h, 5d, 2w, 1m)",
                        "name": "datefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "2024-01-18",
                        "description": "Messages added on or before this date (ISO8601 or relative)",
                        "name": "dateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Messages with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Messages with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Message IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "date",
                            "originalmessageid",
                            "projectid",
                            "itemid",
                            "taskid"
                        ],
                        "type": "string",
                        "default": "id",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "desc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MessageListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Add a Message to a project or item discussion, or reply to an existing message. For new discussions, provide subject, content, contacts, and either projectid or itemid. For replies, provide content and originalmessageid.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Create Message",
                "parameters": [
                    {
                        "description": "Message data",
                        "name": "message",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateMessagePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages/contacts": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds one or more Contacts to one or more Messages.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Add Contacts to Messages",
                "parameters": [
                    {
                        "description": "Message IDs and Contact IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.MessageContactsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Contacts from one or more Messages. Note: you cannot remove a recipient who has replied to the discussion.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Remove Contacts from Messages",
                "parameters": [
                    {
                        "description": "Message IDs and Contact IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.MessageContactsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages/{messageid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Message including all replies. The projectcontacts parameter (staff only) includes the list of contacts assigned to the message's project, for use when composing replies.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Get Message",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Message ID",
                        "name": "messageid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "default": "false",
                        "description": "Return project contacts (staff only)",
                        "name": "projectcontacts",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MessageGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a Message.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Update Message",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Message ID",
                        "name": "messageid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Message data to update",
                        "name": "message",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateMessagePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Deletes a Message.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Delete Message",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Message ID",
                        "name": "messageid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projectnotes": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Project Notes based on the filters specified. The fields parameter allows you to choose which data fields to return for each Project Note.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projectnotes"
                ],
                "summary": "Get Project Notes",
                "parameters": [
                    {
                        "type": "string",
                        "default": "content,title",
                        "description": "Comma-separated list of fields to return. Available fields: \u003cul\u003e\u003cli\u003e\u003cb\u003ecompany\u003c/b\u003e - Company ID and name\u003c/li\u003e\u003cli\u003e\u003cb\u003econtent\u003c/b\u003e - Note body text\u003c/li\u003e\u003cli\u003e\u003cb\u003elastmodified\u003c/b\u003e - Last modified date (UTC)\u003c/li\u003e\u003cli\u003e\u003cb\u003eproject\u003c/b\u003e - Project ID, number, and title\u003c/li\u003e\u003cli\u003e\u003cb\u003etitle\u003c/b\u003e - Note title\u003c/li\u003e\u003c/ul\u003e",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by title. Use ! for negation. Example: website or !layout",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project Category ID or comma-separated list of IDs. Example: 1,2",
                        "name": "categoryid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "default": "active",
                        "description": "Project completion status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project ID or comma-separated list of IDs. Example: 1,2",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Company ID or comma-separated list of IDs. Example: 1,2,3",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only). Example: 1",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Notes with ID greater than or equal to this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Notes with ID less than or equal to this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Comma-separated list of Note IDs. Example: 1,2,3,4",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "projectid",
                            "title"
                        ],
                        "type": "string",
                        "default": "id",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page number (must be used with pagesize). Example: 2",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page size (must be used with pagenumber). Example: 10",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectNoteListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new Project Note.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projectnotes"
                ],
                "summary": "Create Project Note",
                "parameters": [
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectNoteCreatePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projectnotes/{noteid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Project Note.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projectnotes"
                ],
                "summary": "Get Project Note",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Note ID",
                        "name": "noteid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectnoteGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a Project Note.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projectnotes"
                ],
                "summary": "Update Project Note",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Note ID",
                        "name": "noteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectNoteUpdatePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a Project Note.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projectnotes"
                ],
                "summary": "Delete Project Note",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Note ID",
                        "name": "noteid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Projects based on the filters specified.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Projects",
                "parameters": [
                    {
                        "type": "string",
                        "example": "\"title,number,company,startdate,duedate\"",
                        "description": "Comma-separated list of fields to return. Available fields: \u003cul\u003e\u003cli\u003e\u003cb\u003etitle\u003c/b\u003e - Project title\u003c/li\u003e\u003cli\u003e\u003cb\u003enumber\u003c/b\u003e - Project number/reference code\u003c/li\u003e\u003cli\u003e\u003cb\u003edescription\u003c/b\u003e - Project description (HTML)\u003c/li\u003e\u003cli\u003e\u003cb\u003eprivatenotes\u003c/b\u003e - Private notes as HTML (staff only)\u003c/li\u003e\u003cli\u003e\u003cb\u003esortorder\u003c/b\u003e - Sort position\u003c/li\u003e\u003cli\u003e\u003cb\u003edeleted\u003c/b\u003e - Deleted flag\u003c/li\u003e\u003cli\u003e\u003cb\u003ecreatedate\u003c/b\u003e - Date project was created (yyyy-mm-dd)\u003c/li\u003e\u003cli\u003e\u003cb\u003eactiveworkstate\u003c/b\u003e - Work state (active, complete, deleted)\u003c/li\u003e\u003cli\u003e\u003cb\u003etemplate\u003c/b\u003e - Whether the project is a template (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003eisclassic\u003c/b\u003e - Whether the project uses classic mode (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003estatus\u003c/b\u003e - Returns activeworkstate\u003c/li\u003e\u003cli\u003e\u003cb\u003etype\u003c/b\u003e - Client type: internal or external (Advanced plan only)\u003c/li\u003e\u003cli\u003e\u003cb\u003eworkstage\u003c/b\u003e - Work stage ID and name\u003c/li\u003e\u003cli\u003e\u003cb\u003eworkstate\u003c/b\u003e - Returns activeworkstate\u003c/li\u003e\u003cli\u003e\u003cb\u003ecompany\u003c/b\u003e - Client company ID and name\u003c/li\u003e\u003cli\u003e\u003cb\u003einternalclientcontactid\u003c/b\u003e - Internal client contact ID (Advanced plan only)\u003c/li\u003e\u003cli\u003e\u003cb\u003einternalclientteamid\u003c/b\u003e - Internal client team ID (Advanced plan only)\u003c/li\u003e\u003cli\u003e\u003cb\u003einternalclientteamname\u003c/b\u003e - Internal client team name (Advanced plan only)\u003c/li\u003e\u003cli\u003e\u003cb\u003einternalclientgroupid\u003c/b\u003e - Internal client group ID (Advanced plan only)\u003c/li\u003e\u003cli\u003e\u003cb\u003einternalclientgroupname\u003c/b\u003e - Internal client group name (Advanced plan only)\u003c/li\u003e\u003cli\u003e\u003cb\u003emanager\u003c/b\u003e - Project manager contact ID and full name\u003c/li\u003e\u003cli\u003e\u003cb\u003ecategory\u003c/b\u003e - Project category ID and name\u003c/li\u003e\u003cli\u003e\u003cb\u003epriority\u003c/b\u003e - Priority level (integer: 1=Very High, 2=High, 3=Medium, 4=Low, 5=Very Low)\u003c/li\u003e\u003cli\u003e\u003cb\u003econtacts\u003c/b\u003e - Returns clients, contractors, and staff as JSON arrays of contact objects [{id, firstname, lastname}]\u003c/li\u003e\u003cli\u003e\u003cb\u003etags\u003c/b\u003e - Project tags as a JSON array [{id, name, color}]\u003c/li\u003e\u003cli\u003e\u003cb\u003ecustomfields\u003c/b\u003e - Custom field options (Advanced plan only)\u003c/li\u003e\u003cli\u003e\u003cb\u003eteam\u003c/b\u003e - Team ID and name (Advanced plan only)\u003c/li\u003e\u003cli\u003e\u003cb\u003egroup\u003c/b\u003e - Group ID and name (Advanced plan only)\u003c/li\u003e\u003cli\u003e\u003cb\u003estaffid\u003c/b\u003e - Staff contact IDs (comma-separated)\u003c/li\u003e\u003cli\u003e\u003cb\u003econtractorid\u003c/b\u003e - Contractor contact IDs (comma-separated)\u003c/li\u003e\u003cli\u003e\u003cb\u003eclientid\u003c/b\u003e - Client contact IDs (comma-separated)\u003c/li\u003e\u003cli\u003e\u003cb\u003econtactid\u003c/b\u003e - All contact IDs (comma-separated)\u003c/li\u003e\u003cli\u003e\u003cb\u003etagid\u003c/b\u003e - Tag IDs (comma-separated)\u003c/li\u003e\u003cli\u003e\u003cb\u003eicalcontactid\u003c/b\u003e - iCal contact IDs (comma-separated)\u003c/li\u003e\u003cli\u003e\u003cb\u003eintegrationfolderid\u003c/b\u003e - Integration folder IDs (comma-separated)\u003c/li\u003e\u003cli\u003e\u003cb\u003ecustomfieldoptionid\u003c/b\u003e - Custom field option IDs (comma-separated)\u003c/li\u003e\u003cli\u003e\u003cb\u003edates\u003c/b\u003e - All date fields: startdate, duedate, completedate\u003c/li\u003e\u003cli\u003e\u003cb\u003estartdate\u003c/b\u003e - Start date (yyyy-mm-dd)\u003c/li\u003e\u003cli\u003e\u003cb\u003eduedate\u003c/b\u003e - Due date (yyyy-mm-dd)\u003c/li\u003e\u003cli\u003e\u003cb\u003ecompletedate\u003c/b\u003e - Completion date (yyyy-mm-dd)\u003c/li\u003e\u003cli\u003e\u003cb\u003elastmodified\u003c/b\u003e - Last modified date in ISO8601 format (UTC)\u003c/li\u003e\u003cli\u003e\u003cb\u003eclientaccess\u003c/b\u003e - Client access enabled (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003eclientviewalltasks\u003c/b\u003e - Client can view all tasks (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003eclientviewtime\u003c/b\u003e - Client can view time (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003estaffviewalltasks\u003c/b\u003e - Staff can view all tasks (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003epurchaseordernumber\u003c/b\u003e - Client purchase order reference\u003c/li\u003e\u003cli\u003e\u003cb\u003enotification\u003c/b\u003e - Notifications enabled (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003emessagessortorder\u003c/b\u003e - Messages sort order\u003c/li\u003e\u003cli\u003e\u003cb\u003epdmodulesrightcontainer\u003c/b\u003e - Right container module config\u003c/li\u003e\u003cli\u003e\u003cb\u003epdmodulesmaincontainer\u003c/b\u003e - Main container module config\u003c/li\u003e\u003cli\u003e\u003cb\u003etimeallocated\u003c/b\u003e - Total time allocated in decimal hours\u003c/li\u003e\u003cli\u003e\u003cb\u003etimetracked\u003c/b\u003e - Total time spent/tracked in decimal hours\u003c/li\u003e\u003cli\u003e\u003cb\u003etimebillable\u003c/b\u003e - Total billable time in decimal hours\u003c/li\u003e\u003cli\u003e\u003cb\u003ebudget\u003c/b\u003e - Project budget including tax (decimal, 2dp)\u003c/li\u003e\u003cli\u003e\u003cb\u003eburn\u003c/b\u003e - Financial burn (decimal, 2dp)\u003c/li\u003e\u003cli\u003e\u003cb\u003ebilltotal\u003c/b\u003e - Total bill amount including tax (decimal, 2dp)\u003c/li\u003e\u003cli\u003e\u003cb\u003einvoicetotal\u003c/b\u003e - Total invoiced amount including tax (decimal, 2dp)\u003c/li\u003e\u003cli\u003e\u003cb\u003epaidamount\u003c/b\u003e - Total paid amount including tax (decimal, 2dp)\u003c/li\u003e\u003cli\u003e\u003cb\u003einvoiced\u003c/b\u003e - Invoiced status (boolean)\u003c/li\u003e\u003cli\u003e\u003cb\u003epercentcomplete\u003c/b\u003e - Percentage of tasks completed (integer 0-100, heading tasks excluded)\u003c/li\u003e\u003cli\u003e\u003cb\u003escoring\u003c/b\u003e - Scoring/aggregate fields: storypoints, itemscompleted, itemsactive, itemstartdate, itemduedate\u003c/li\u003e\u003cli\u003e\u003cb\u003ediscount\u003c/b\u003e - Discount fields: itemsdiscount\u003c/li\u003e\u003cli\u003e\u003cb\u003eunits\u003c/b\u003e - Unit/pricing fields: inunittotal, outunittotal, costratetype, chargeratetype\u003c/li\u003e\u003cli\u003e\u003cb\u003ebudgetdetail\u003c/b\u003e - Budget detail fields: budgettype, budgettax\u003c/li\u003e\u003cli\u003e\u003cb\u003ebillingdetail\u003c/b\u003e - Billing detail fields: billtype, billamount, billamounttax\u003c/li\u003e\u003cli\u003e\u003cb\u003eestimated\u003c/b\u003e - Estimated cost/revenue: estinlabour, estintotal, estintotaltax, estoutlabour, estbillamount, estbillamounttax\u003c/li\u003e\u003cli\u003e\u003cb\u003eactual\u003c/b\u003e - Actual cost/revenue: actualinlabour, actualintotal, actualintotaltax, actualoutlabour\u003c/li\u003e\u003cli\u003e\u003cb\u003eprojected\u003c/b\u003e - Projected values: projectedtimemanual, projectedtimespent, projectedbillamount, projectedbillamounttax\u003c/li\u003e\u003cli\u003e\u003cb\u003eprofit\u003c/b\u003e - Profit/margin fields: estprofit, projectedprofit, estgrossmargin, projectedgrossmargin\u003c/li\u003e\u003cli\u003e\u003cb\u003einvoiceddetail\u003c/b\u003e - Invoiced detail fields: invoicedamount, invoicedamounttax, paidamounttax\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - Returns all available scalar fields\u003c/li\u003e\u003c/ul\u003e\u003cb\u003eSub-entity fields\u003c/b\u003e (heavy — NOT included by \u003cb\u003eall\u003c/b\u003e, must be named explicitly): \u003cb\u003ephases\u003c/b\u003e - project phases and their tasks; \u003cb\u003etimerecords\u003c/b\u003e - time records; \u003cb\u003emessages\u003c/b\u003e - messages; \u003cb\u003efiles\u003c/b\u003e - files; \u003cb\u003efolders\u003c/b\u003e - folders; \u003cb\u003einvoices\u003c/b\u003e - linked invoices; \u003cb\u003eworkstages\u003c/b\u003e - project workstage history; \u003cb\u003ebookmarks\u003c/b\u003e - bookmarks; \u003cb\u003eprojectnotes\u003c/b\u003e - project notes. Use e.g. \u003ci\u003efields=all,phases\u003c/i\u003e or \u003ci\u003efields=phases,timerecords\u003c/i\u003e.",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "[Deprecated: use title instead] Search. \u003cul\u003e\u003cli\u003e\u003cb\u003estring\u003c/b\u003e - Projects where Number or Title contains string\u003cbr\u003eExample: website\u003c/li\u003e\u003cli\u003e\u003cb\u003e!string\u003c/b\u003e - Projects where Number and Title do not contain string\u003cbr\u003eExample: !layout\u003c/li\u003e\u003c/ul\u003e",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "[Deprecated: use number instead] Search Number. \u003cul\u003e\u003cli\u003e\u003cb\u003estring\u003c/b\u003e - Projects where Number contains string\u003cbr\u003eExample: PRJ-2024\u003c/li\u003e\u003cli\u003e\u003cb\u003e!string\u003c/b\u003e - Projects where Number does not contain string\u003cbr\u003eExample: !TEST\u003c/li\u003e\u003c/ul\u003e",
                        "name": "searchnumber",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by exact Title. Example: Website Redesign",
                        "name": "title",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by exact Number. Example: PRJ-001",
                        "name": "number",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Fuzzy search term. Searches the fields specified by qfields (default: number and title). Example: website",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Comma-separated list of fields to apply fuzzy search (q) to. Allowed values: number, title. Defaults to both when q is set. Example: number,title",
                        "name": "qfields",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "active",
                        "description": "Status (activeworkstate). \u003cul\u003e\u003cli\u003e\u003cb\u003eactive\u003c/b\u003e - Active Projects\u003c/li\u003e\u003cli\u003e\u003cb\u003ecomplete\u003c/b\u003e - Completed Projects\u003c/li\u003e\u003cli\u003e\u003cb\u003edeleted\u003c/b\u003e - Deleted Projects\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - All Projects (excludes deleted)\u003c/li\u003e\u003c/ul\u003e",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Alias for status parameter.",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Company ID or List of Company IDs. \u003cul\u003e\u003cli\u003e\u003cb\u003ecompanyid/s\u003c/b\u003e - Projects in specified Company/ies\u003cbr\u003eExample: 1,2,3\u003c/li\u003e\u003cli\u003e\u003cb\u003e!companyid/s\u003c/b\u003e - Projects NOT for specified Company/ies\u003c/li\u003e\u003c/ul\u003e",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "default": "all",
                        "description": "Manager. \u003cul\u003e\u003cli\u003e\u003cb\u003emanagerid/s\u003c/b\u003e - Contact ID or List of Contact IDs - Projects Managed by any of the specified Contact/s\u003cbr\u003eExample: 1,2\u003c/li\u003e\u003cli\u003e\u003cb\u003e!managerid/s\u003c/b\u003e - Contact ID or List of Contact IDs - Projects NOT Managed by any of the specified Contact/s\u003cbr\u003eExample: !1,2\u003c/li\u003e\u003cli\u003e\u003cb\u003eme\u003c/b\u003e - Projects Managed by Contact making request\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - All Projects\u003c/li\u003e\u003c/ul\u003e",
                        "name": "managerid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "default": "all",
                        "description": "Contacts. \u003cul\u003e\u003cli\u003e\u003cb\u003econtactid/s\u003c/b\u003e - Contact ID or List of Contact IDs - Projects assigned to ANY/ALL specified Contact/s (see contactsmode parameter)\u003cbr\u003eExample: 1,2\u003c/li\u003e\u003cli\u003e\u003cb\u003e!contactid/s\u003c/b\u003e - Contact ID or List of Contact IDs - Projects NOT assigned to ANY/ALL specified Contact/s (see contactsmode parameter)\u003cbr\u003eExample: !1,2\u003c/li\u003e\u003cli\u003e\u003cb\u003eme\u003c/b\u003e - Projects assigned to Contact making request\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - All Projects\u003c/li\u003e\u003c/ul\u003e",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "any",
                            "all"
                        ],
                        "type": "string",
                        "default": "any",
                        "description": "Mode used for the contacts parameter. \u003cul\u003e\u003cli\u003e\u003cb\u003eany\u003c/b\u003e - Projects assigned to ANY of the specified contacts\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - Projects assigned to ALL of the specified contacts\u003c/li\u003e\u003c/ul\u003e",
                        "name": "contactsmode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Team (Advanced plan only). \u003cul\u003e\u003cli\u003e\u003cb\u003eteamid/s\u003c/b\u003e - Team ID or List of Team IDs - Projects Managed by any of the specified Team/s\u003cbr\u003eExample: 1,2\u003c/li\u003e\u003cli\u003e\u003cb\u003e!teamid/s\u003c/b\u003e - Team ID or List of Team IDs - Projects NOT Managed by any of the specified Team/s\u003cbr\u003eExample: !1,2\u003c/li\u003e\u003c/ul\u003e",
                        "name": "teamid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Group (Advanced plan only). \u003cul\u003e\u003cli\u003e\u003cb\u003egroupid/s\u003c/b\u003e - Group ID or List of Group IDs - Projects Managed by any of the specified Group/s\u003cbr\u003eExample: 1,2\u003c/li\u003e\u003cli\u003e\u003cb\u003e!groupid/s\u003c/b\u003e - Group ID or List of Group IDs - Projects NOT Managed by any of the specified Group/s\u003cbr\u003eExample: !1,2\u003c/li\u003e\u003c/ul\u003e",
                        "name": "groupid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Category ID or List of Category IDs. \u003cul\u003e\u003cli\u003e\u003cb\u003ecategoryid/s\u003c/b\u003e - Projects in specified Category/ies\u003cbr\u003eExample: 1,2,3\u003c/li\u003e\u003cli\u003e\u003cb\u003e!categoryid/s\u003c/b\u003e - Projects NOT in specified Category/ies\u003cbr\u003eExample: !1,2,3\u003c/li\u003e\u003c/ul\u003e",
                        "name": "categoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag ID or List of Tag IDs. \u003cul\u003e\u003cli\u003e\u003cb\u003etagid/s\u003c/b\u003e - Projects with specified Tag/s\u003cbr\u003eExample: 1,2,3\u003c/li\u003e\u003cli\u003e\u003cb\u003e!tagid/s\u003c/b\u003e - Projects without specified Tag/s\u003cbr\u003eExample: !1,2,3\u003c/li\u003e\u003c/ul\u003e",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Priority or List of Priorities (1-5 representing Very High-Very Low). \u003cul\u003e\u003cli\u003e\u003cb\u003epriority/ies\u003c/b\u003e - Projects with specified Priority/ies\u003cbr\u003eExample: 1,2\u003c/li\u003e\u003cli\u003e\u003cb\u003e!priority/ies\u003c/b\u003e - Projects NOT with specified Priority/ies\u003cbr\u003eExample: !4,5\u003c/li\u003e\u003c/ul\u003e",
                        "name": "priority",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Workstage ID or List of Workstage IDs . \u003cul\u003e\u003cli\u003e\u003cb\u003eworkstageid/s\u003c/b\u003e - Projects with specified Workstages\u003cbr\u003eExample: 1,2\u003c/li\u003e\u003cli\u003e\u003cb\u003e!workstageid/s\u003c/b\u003e - Projects without specified Workstages\u003cbr\u003eExample: !1,2\u003c/li\u003e\u003c/ul\u003e",
                        "name": "workstageid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects starting on or after this date. \u003cul\u003e\u003cli\u003e\u003cb\u003eSpecific date\u003c/b\u003e - Date in yyyy-mm-dd format\u003cbr\u003eExample: 2014-01-18\u003c/li\u003e\u003cli\u003e\u003cb\u003eRelative date\u003c/b\u003e - +/-Xd/w/m/y\u003cbr\u003eExamples: -3w - 3 weeks ago OR +1m - 1 month ahead\u003c/li\u003e\u003c/ul\u003e",
                        "name": "startdatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects starting on or before this date. \u003cul\u003e\u003cli\u003e\u003cb\u003eSpecific date\u003c/b\u003e - Date in yyyy-mm-dd format\u003cbr\u003eExample: 2014-01-18\u003c/li\u003e\u003cli\u003e\u003cb\u003eRelative date\u003c/b\u003e - +/-Xd/w/m/y\u003cbr\u003eExamples: -3w - 3 weeks ago OR +1m - 1 month ahead\u003c/li\u003e\u003c/ul\u003e",
                        "name": "startdateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects due on or after this date. \u003cul\u003e\u003cli\u003e\u003cb\u003eSpecific date\u003c/b\u003e - Date in yyyy-mm-dd format\u003cbr\u003eExample: 2014-01-18\u003c/li\u003e\u003cli\u003e\u003cb\u003eRelative date\u003c/b\u003e - +/-Xd/w/m/y\u003cbr\u003eExamples: -3w - 3 weeks ago OR +1m - 1 month ahead\u003c/li\u003e\u003c/ul\u003e",
                        "name": "duedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects due on or before this date. \u003cul\u003e\u003cli\u003e\u003cb\u003eSpecific date\u003c/b\u003e - Date in yyyy-mm-dd format\u003cbr\u003eExample: 2014-01-18\u003c/li\u003e\u003cli\u003e\u003cb\u003eRelative date\u003c/b\u003e - +/-Xd/w/m/y\u003cbr\u003eExamples: -3w - 3 weeks ago OR +1m - 1 month ahead\u003c/li\u003e\u003c/ul\u003e",
                        "name": "duedateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects completed on or after this date. \u003cul\u003e\u003cli\u003e\u003cb\u003eSpecific date\u003c/b\u003e - Date in yyyy-mm-dd format\u003cbr\u003eExample: 2014-01-18\u003c/li\u003e\u003cli\u003e\u003cb\u003eRelative date\u003c/b\u003e - +/-Xd/w/m/y\u003cbr\u003eExamples: -3w - 3 weeks ago OR +1m - 1 month ahead\u003c/li\u003e\u003c/ul\u003e",
                        "name": "completedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects completed on or before this date. \u003cul\u003e\u003cli\u003e\u003cb\u003eSpecific date\u003c/b\u003e - Date in yyyy-mm-dd format\u003cbr\u003eExample: 2014-01-18\u003c/li\u003e\u003cli\u003e\u003cb\u003eRelative date\u003c/b\u003e - +/-Xd/w/m/y\u003cbr\u003eExamples: -3w - 3 weeks ago OR +1m - 1 month ahead\u003c/li\u003e\u003c/ul\u003e",
                        "name": "completedateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects added/edited on or after this date (UTC). ISO8601 or relative (12h, 5d, 2w, 1m)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects added/edited on or before this date (UTC). ISO8601 or relative (12h, 5d, 2w, 1m)",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "number",
                            "title",
                            "startdate",
                            "duedate",
                            "completedate",
                            "companyname",
                            "categoryname",
                            "priority"
                        ],
                        "type": "string",
                        "default": "number",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates one or more projects by ID. All fields except ids are optional — only provided fields are updated.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Bulk Update Projects",
                "parameters": [
                    {
                        "description": "Project IDs and fields to update",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkUpdateProjectsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new external project with a company as the client. This endpoint now proxies to POST /projects/external.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Projects",
                "parameters": [
                    {
                        "description": "External project data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateExternalProjectPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes one or more projects by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Bulk Delete Projects",
                "parameters": [
                    {
                        "description": "Project IDs to delete",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkDeleteProjectsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/adjustdates": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Shifts start and due dates on one or more projects by a number of days. Negative values shift backwards. Optionally shifts child item dates too.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Bulk Adjust Project Dates",
                "parameters": [
                    {
                        "description": "Project IDs and day offset",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkAdjustProjectDatesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/bookmarks": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Bookmarks across all Projects.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get All Project Bookmarks",
                "parameters": [
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectBookmarkListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/contacts": {
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Contacts from one or more Projects.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Remove Contacts from Projects",
                "parameters": [
                    {
                        "description": "Project IDs and Contact IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RemoveContactsFromProjectsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/external": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new external project with a company as the client.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create External Project",
                "parameters": [
                    {
                        "description": "External project data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateExternalProjectPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/internal": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new internal project with a staff member as the client.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Internal Project",
                "parameters": [
                    {
                        "description": "Internal project data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateInternalProjectPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/invoices": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates an Invoice based on project items.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Invoice From Project",
                "parameters": [
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateInvoiceFromProjectPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of all project Items across all projects, based on the filters specified. The fields parameter allows you to choose which data fields to return for each Item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Items",
                "parameters": [
                    {
                        "type": "string",
                        "default": "name,status,priority",
                        "description": "Comma-separated list of fields to return. Available fields: \u003cul\u003e\u003cli\u003e\u003cb\u003ename\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003ecode\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003enumber\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003edescription\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003estatus\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003epriority\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003epercentcomplete\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eposition\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eproject\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003ecompany\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003edates\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003etime\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003ebillable\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eworkstageid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eparentid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003ephasename\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003ecategoryid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eitemcollectionid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eitemtypeid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003ecreatedon\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003econtacts\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003etags\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003elastmodified\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003ehourlyrateserviceid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eproductid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003etimebillable\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003ecreatorid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003euniquetoken\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003edeleted\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eprerequisiteid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003edependenttaskid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003econtactid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003etagid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003equoteitemid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003einvoiceitemid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003etrackingoptionid\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003escoring\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003ediscount\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eunits\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003etax\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eestimated\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eactual\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eprojected\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eprofit\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003ebudget\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003ebilling\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003einvoiced\u003c/b\u003e\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use name, code, or q+qfields instead. Search by name or code. Use ! for negation.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use q+qfields instead. Search by name. Use ! for negation.",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use q+qfields instead. Search by description. Use ! for negation.",
                        "name": "searchdescription",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use code or q+qfields instead. Search by code. Use ! for negation.",
                        "name": "searchcode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact name match",
                        "name": "name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact code match",
                        "name": "code",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Fuzzy search term (use with qfields to restrict fields searched)",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "name",
                            "code",
                            "description"
                        ],
                        "type": "string",
                        "description": "Comma-separated fields to fuzzy search",
                        "name": "qfields",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "active",
                        "description": "Status filter",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Alias for status parameter.",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Priority filter (comma-separated: 1=Very High … 5=Very Low)",
                        "name": "priority",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Company IDs (comma-separated)",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Contact IDs assigned to item, 'me', or 'unassigned' for items with no contacts",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "any",
                            "all"
                        ],
                        "type": "string",
                        "default": "any",
                        "description": "Mode for contacts filter",
                        "name": "contactsmode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag IDs (comma-separated)",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Work Stage ID",
                        "name": "workstageid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start date from (yyyy-mm-dd)",
                        "name": "startdatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start date to (yyyy-mm-dd)",
                        "name": "startdateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date from (yyyy-mm-dd)",
                        "name": "duedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date to (yyyy-mm-dd)",
                        "name": "duedateto",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified UTC from (ISO8601 or relative)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Last modified UTC to (ISO8601 or relative)",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Items with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Items with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Item IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "code",
                            "priority",
                            "startdate",
                            "duedate",
                            "completedate",
                            "status",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "name",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectItemListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates one or more project items by ID. All fields except ids are optional — only provided fields are updated.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Bulk Update Project Items",
                "parameters": [
                    {
                        "description": "Item IDs and fields to update",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkUpdateItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Create an Item (assigns to a project via projectid in the request body).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Item",
                "parameters": [
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateItemPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/clone": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Clones one or more project items (tasks) into a target phase (item collection).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Clone Items",
                "parameters": [
                    {
                        "description": "Item IDs and destination collection ID",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CloneItemsRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/complete": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Marks one or more project items as complete.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Complete Items",
                "parameters": [
                    {
                        "description": "Array of item IDs to complete",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CompleteItemsRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/contacts": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds one or more Contacts to one or more Items (Tasks).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Add Contacts to Items",
                "parameters": [
                    {
                        "description": "Item IDs and Contact IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactsToItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Contacts from one or more Items (Tasks).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Remove Contacts from Items",
                "parameters": [
                    {
                        "description": "Item IDs and Contact IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactsToItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/contacts/all": {
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes all Contacts from one or more Items (Tasks).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Remove All Contacts from Items",
                "parameters": [
                    {
                        "description": "Item IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RemoveAllContactsFromItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/move": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Moves one or more project items (tasks) to a different phase (item collection).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Move Items to Phase",
                "parameters": [
                    {
                        "description": "Item IDs and destination phase ID",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.MoveItemsRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/prerequisites": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds one or more prerequisite Items to one or more Items (Tasks).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Add Prerequisites to Items",
                "parameters": [
                    {
                        "description": "Item IDs and Prerequisite Item IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PrerequisitesToItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more prerequisite Items from one or more Items (Tasks).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Remove Prerequisites from Items",
                "parameters": [
                    {
                        "description": "Item IDs and Prerequisite Item IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PrerequisitesToItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/tags": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds one or more Tags to one or more Items (Tasks).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Add Tags to Items",
                "parameters": [
                    {
                        "description": "Item IDs and Tag IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.TagsToItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Tags from one or more Items (Tasks).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Remove Tags from Items",
                "parameters": [
                    {
                        "description": "Item IDs and Tag IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.TagsToItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/tags/all": {
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes all Tags from one or more Items (Tasks).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Remove All Tags from Items",
                "parameters": [
                    {
                        "description": "Item IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RemoveAllTagsFromItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/tracking": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds accounting integration tracking options to one or more Items (Tasks).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Add Tracking Options to Items",
                "parameters": [
                    {
                        "description": "Item IDs and Tracking Option IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.TrackingOptionsToItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes accounting integration tracking options from one or more Items (Tasks).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Remove Tracking Options from Items",
                "parameters": [
                    {
                        "description": "Item IDs and Tracking Option IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.TrackingOptionsToItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/workstage": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Sets the active work stage for multiple project items.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Bulk Update Project Item Work Stage",
                "parameters": [
                    {
                        "description": "Item IDs and work stage",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkUpdateItemWorkStageRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/{itemid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single project item by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectItemGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Update an existing Item. Only provide the fields you want to update.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Item update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateItemPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft delete an Item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Delete Project Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/{itemid}/files": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Upload a file to a Project Item (task folder). Send a multipart/form-data request with the file in the \"file\" field. The file is placed in the item's task folder. Blocked extensions: exe, msi, ini, bin, bat, cfm, cfc, asp, aspx, php, config, vb, java, pl.",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Upload Project Item File",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "file",
                        "description": "File to upload",
                        "name": "file",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.FileUploadResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/{itemid}/order": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Moves a project item before or after another item using sortorder. Provide exactly one of placeafterid or placebeforeid.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Reorder Project Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Order placement",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateItemOrderRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/items/{itemid}/workstage": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Sets the active work stage for a project item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project Item Work Stage",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Work stage",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateItemWorkStageRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/overdue": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns active projects that are past their due date. Supports the same field selection, filtering, sorting, and pagination as GET /projects.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Overdue Projects",
                "parameters": [
                    {
                        "type": "string",
                        "default": "title,number,company,startdate,duedate",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by number or title. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by project number. Supports ! for negation.",
                        "name": "searchnumber",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "Company ID or list of Company IDs. Prefix with ! to negate.",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Manager Contact IDs, 'me', or 'all'. Prefix with ! to negate.",
                        "name": "managerid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Contact IDs, 'me', or 'all'. Prefix with ! to negate.",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "any",
                            "all"
                        ],
                        "type": "string",
                        "default": "any",
                        "description": "Mode for contacts filter",
                        "name": "contactsmode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Team IDs (Advanced plan only). Prefix with ! to negate.",
                        "name": "teamid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Group IDs (Advanced plan only). Prefix with ! to negate.",
                        "name": "groupid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "Category IDs. Prefix with ! to negate.",
                        "name": "categoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "Tag IDs. Prefix with ! to negate.",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Priority or list of Priorities (1-5). Prefix with ! to negate.",
                        "name": "priority",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Workstage IDs. Prefix with ! to negate.",
                        "name": "workstageid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "-3w",
                        "description": "Projects starting on or after this date (yyyy-mm-dd or relative: -3w)",
                        "name": "startdatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "+0d",
                        "description": "Projects starting on or before this date (yyyy-mm-dd or relative)",
                        "name": "startdateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "-6d",
                        "description": "Projects due on or after this date (yyyy-mm-dd or relative)",
                        "name": "duedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects completed on or after this date (yyyy-mm-dd or relative)",
                        "name": "completedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects completed on or before this date (yyyy-mm-dd or relative)",
                        "name": "completedateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects modified on or after this date in UTC (ISO8601 or relative)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects modified on or before this date in UTC (ISO8601 or relative)",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Projects with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "List of Project IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "number",
                            "title",
                            "startdate",
                            "duedate",
                            "completedate",
                            "companyname",
                            "categoryname",
                            "priority"
                        ],
                        "type": "string",
                        "default": "duedate",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/phases": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns phases (item collections) across all projects with aggregated financial and progress metrics. Optionally filter by one or more project IDs. Access is contact-filtered based on the authenticated user's project membership.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Phases",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,projectid,parentid,timeallocated,timespent,estBillAmount,billAmount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by phase name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Project ID or comma-separated list of Project IDs to filter by",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to phases with a specific parent phase ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder",
                            "startdate",
                            "duedate"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Phases modified on or after this date (UTC). ISO8601 or relative (12h, 5d, 2w, 1m)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Phases modified on or before this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectPhaseListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates one or more project phases by ID. All fields except ids are optional.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Bulk Update Project Phases",
                "parameters": [
                    {
                        "description": "Phase IDs and fields to update",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkUpdatePhasesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds a Phase (Item Collection).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Project Phase",
                "parameters": [
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.PhaseCreatePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/phases/adjustdates": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Shifts item dates within one or more project phases by a number of days. Negative values shift backwards.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Bulk Adjust Project Phase Dates",
                "parameters": [
                    {
                        "description": "Phase IDs and day offset",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkAdjustPhaseDatesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/phases/{phaseid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single phase (item collection) by ID. Equivalent to GET /projects/{projectid}/phases/{phaseid} but looks up the phase by ID alone.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectPhaseGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing Phase.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Phase update data",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.PhaseUpdatePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a Phase and its associated items.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Delete Project Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/quotes": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a Quote based on project items.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Quote From Project",
                "parameters": [
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateQuoteFromProjectPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/tags": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds one or more Tags to one or more Projects.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Add Tags to Projects",
                "parameters": [
                    {
                        "description": "Project IDs and Tag IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.TagsToProjectsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Tags from one or more Projects.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Remove Tags from Projects",
                "parameters": [
                    {
                        "description": "Project IDs and Tag IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RemoveTagsFromProjectsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/tags/all": {
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes all Tags from one or more Projects.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Remove All Tags from Projects",
                "parameters": [
                    {
                        "description": "Project IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RemoveAllTagsFromProjectsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Project. By default returns all scalar fields. Add sub-entity names to fields to include them (e.g. fields=all,phases). Sub-entities are never included by \"all\" — they must be requested explicitly.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "all",
                        "description": "Comma-separated fields to return (or 'all'). Sub-entities: phases, timerecords, messages, files, folders, invoices, workstages, bookmarks, projectnotes. Example: all,phases or phases,timerecords",
                        "name": "fields",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Project update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateProjectPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Delete Project",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/access/{contactid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Check whether a contact can view a Project. Staff can check access for any contact; non-staff contacts are always checked against themselves.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Check Project Access",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Contact ID or 'me'",
                        "name": "contactid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "default": "false",
                        "description": "Return project title and number when access is granted",
                        "name": "details",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectAccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/adjustdates": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Shifts all dates on a Project forward or backward by a specified number of days.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Adjust Project Dates",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.AdjustProjectDatesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/bookmarks": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Bookmarks for a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Bookmarks",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectBookmarkListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds a Bookmark to a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Project Bookmark",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateProjectBookmarkPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/bookmarks/{bookmarkid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Bookmark for a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Bookmark",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Bookmark ID",
                        "name": "bookmarkid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectBookmarkGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a Project Bookmark.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project Bookmark",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Bookmark ID",
                        "name": "bookmarkid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateProjectBookmarkPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a Project Bookmark.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Delete Project Bookmark",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Bookmark ID",
                        "name": "bookmarkid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/clone": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Clones an existing project, optionally including its items and tags.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Clone Project",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID to clone",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Clone options (title is required)",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CloneProjectNexusRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.CloneProjectNexusResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/complete": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Marks a Project as complete.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Complete Project",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/contacts": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the Contacts assigned to a Project (staff, clients, contractors, and the project manager).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Get Project Contacts",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "id,name,company,type",
                        "description": "Comma-separated list of fields to return. Available fields: address, company, image, lastmodified, name, roles, type",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by name. Use ! prefix for negation",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by email. Use ! prefix for negation",
                        "name": "searchemail",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "client",
                            "contractor",
                            "staff",
                            "other"
                        ],
                        "type": "string",
                        "description": "Filter by contact type",
                        "name": "type",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "Tag ID or comma-separated list of Tag IDs",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "Role ID or comma-separated list of Role IDs",
                        "name": "roleid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "Group ID or comma-separated list of Group IDs",
                        "name": "groupid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "description": "Filter by pending status",
                        "name": "pending",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false"
                        ],
                        "type": "string",
                        "description": "Filter by login access",
                        "name": "allowlogin",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "12h",
                        "description": "Contacts modified on or after this date (UTC, ISO8601 or relative)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "2024-01-18",
                        "description": "Contacts modified on or before this date (UTC, ISO8601 or relative)",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Contacts with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Contacts with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "Comma-separated list of Contact IDs",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "firstname",
                            "lastname"
                        ],
                        "type": "string",
                        "default": "firstname",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates the Contacts assigned to a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Update Project Contacts",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateProjectContactsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Contacts from a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Remove Project Contacts",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateProjectContactsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/customfields/{customfieldid}": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Sets the value of a single custom field on a project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project Custom Field Value",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Custom Field ID",
                        "name": "customfieldid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Custom field value",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateProjectCustomFieldPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/files": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Files for a Project based on the specified filters. The fields parameter allows you to choose which data fields to return for each File.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Files",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "name,item,date,size,link",
                        "description": "Comma-separated list of fields to return. Available: date, description, folder, link, name, owner, size, item",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "report",
                        "description": "Search by file name. Use ! prefix for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Filter by item activeworkstate",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Item ID or comma-separated list of Item IDs",
                        "name": "itemid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Folder ID or comma-separated list of Folder IDs",
                        "name": "folderid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "2024-01-18",
                        "description": "Files modified on or after this date (ISO8601 or relative: 12h, 5d)",
                        "name": "datefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "2024-01-18",
                        "description": "Files modified on or before this date (ISO8601 or relative)",
                        "name": "dateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Files with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Files with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "List of File IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "size",
                            "date",
                            "itemid",
                            "folderid"
                        ],
                        "type": "string",
                        "default": "name",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.FileListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Upload a file to a Project's root folder. Send a multipart/form-data request with the file in the \"file\" field. To upload to a custom folder use POST /files/folders/{folderid}/files; to upload to a task folder use POST /projects/items/{itemid}/files. Blocked extensions: exe, msi, ini, bin, bat, cfm, cfc, asp, aspx, php, config, vb, java, pl.",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Upload Project File",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "file",
                        "description": "File to upload",
                        "name": "file",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.FileUploadResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/folders": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of custom Folders for a Project based on the specified filters.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Folders",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "name",
                        "description": "Comma-separated fields to return. Available: name, description, type, size, date, owner, contacts, item, public",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "reports",
                        "description": "Search by folder name. Use ! prefix for negation",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Folders with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Folders with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "List of Folder IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name"
                        ],
                        "type": "string",
                        "default": "name",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.FolderListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/invoices": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Invoices for a Project based on the specified filters.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Invoices",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "number,title,company,status,totals,projectid,invoiceddate,duedate",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by number or title. Use ! prefix for negation.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by invoice number. Supports ! for negation.",
                        "name": "searchnumber",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by invoice title. Supports ! for negation.",
                        "name": "searchtitle",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "draft",
                            "submitted",
                            "authorised",
                            "paid",
                            "voided",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Invoice status",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by taxable status",
                        "name": "taxable",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project manager Contact IDs (comma-separated)",
                        "name": "managerid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project category IDs (comma-separated)",
                        "name": "projectcategoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Company IDs (comma-separated)",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoiced date from (ISO8601 or relative: 12h, 5d, 2w, 1m)",
                        "name": "invoiceddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoiced date to (ISO8601 or relative)",
                        "name": "invoiceddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date from (ISO8601 or relative)",
                        "name": "duedatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Due date to (ISO8601 or relative)",
                        "name": "duedateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Paid date from (ISO8601 or relative)",
                        "name": "paiddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Paid date to (ISO8601 or relative)",
                        "name": "paiddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total minimum",
                        "name": "grandtotalfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total maximum",
                        "name": "grandtotalto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "company",
                            "project",
                            "status",
                            "day",
                            "week",
                            "month",
                            "year"
                        ],
                        "type": "string",
                        "description": "Group results by. Returns subtotals per group.",
                        "name": "subtotals",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "invoiced",
                            "due",
                            "paid"
                        ],
                        "type": "string",
                        "description": "Date field for subtotals grouping",
                        "name": "subtotalsdateoption",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoices modified on or after this date (UTC, ISO8601 or relative)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoices modified on or before this date (UTC, ISO8601 or relative)",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoices with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Invoices with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Invoice IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "number",
                            "title",
                            "invoiceddate",
                            "duedate",
                            "companyname"
                        ],
                        "type": "string",
                        "default": "number",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/items": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns items for a project. Supports the same field selection, filtering, sorting, and pagination as GET /projects/items.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Items",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "name,status,priority",
                        "description": "Fields to return (see GET /projects/items for full list)",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use name, code, or q+qfields instead. Search by name or code. Use ! for negation.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use q+qfields instead. Search by name. Use ! for negation.",
                        "name": "searchname",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use q+qfields instead. Search by description. Use ! for negation.",
                        "name": "searchdescription",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use code or q+qfields instead. Search by code. Use ! for negation.",
                        "name": "searchcode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact name match",
                        "name": "name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact code match",
                        "name": "code",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Fuzzy search term (use with qfields to restrict fields searched)",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "name",
                            "code",
                            "description"
                        ],
                        "type": "string",
                        "description": "Comma-separated fields to fuzzy search",
                        "name": "qfields",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "active",
                        "description": "Status filter",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Alias for status parameter.",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Priority filter (comma-separated)",
                        "name": "priority",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Contact IDs or 'me' or 'unassigned'",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "any",
                            "all"
                        ],
                        "type": "string",
                        "default": "any",
                        "description": "Contacts filter mode",
                        "name": "contactsmode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Tag IDs (comma-separated)",
                        "name": "tagid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Work Stage ID",
                        "name": "workstageid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "code",
                            "priority",
                            "startdate",
                            "duedate",
                            "completedate",
                            "status",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "name",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectItemListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Add an Item to a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Project Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateProjectItemPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/items/{itemid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single project item by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectItemGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing project item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Item update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateProjectItemPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-deletes a project item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Delete Project Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/items/{itemid}/workstages": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the workstage history for a project item. Access is contact-filtered based on the authenticated user's project membership.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Item Workstage History",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "enum": [
                            "setdatetime",
                            "id"
                        ],
                        "type": "string",
                        "default": "setdatetime",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "desc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ItemWorkStageHistoryListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/messages": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Messages for a Project based on the specified filters.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Messages",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "subject,content,originalmessageid,project,item,date,author,contacts,public,files",
                        "description": "Comma-separated list of fields to return. Available fields: subject, content, originalmessageid, project, item, date, author, contacts, public, files, replycount, all",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by subject. Use ! prefix for negation.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Filter by contact. Comma-separated Contact IDs, 'me', or 'all'",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Filter by item activeworkstate",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Item ID or list of Item IDs (comma-separated)",
                        "name": "itemid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Original Message ID - returns messages in the discussion started by this message",
                        "name": "originalmessageid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "2024-01-18",
                        "description": "Messages added on or after this date (ISO8601 or relative: 12h, 5d, 2w, 1m)",
                        "name": "datefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "2024-01-18",
                        "description": "Messages added on or before this date (ISO8601 or relative)",
                        "name": "dateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Messages with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Messages with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Message IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "date",
                            "originalmessageid",
                            "itemid"
                        ],
                        "type": "string",
                        "default": "id",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "desc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MessageListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a Message for a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Project Message",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateProjectMessagePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/order": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Moves a project before or after another project using sortorder. Provide exactly one of placeafterid or placebeforeid.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Reorder Project",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Order placement",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateProjectOrderRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/phases": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns phases (item collections) for a project with aggregated financial and progress metrics. Access is contact-filtered based on the authenticated user's project membership.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Phases",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "id,name,projectid,parentid,timeallocated,timespent,estBillAmount,billAmount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by phase name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to phases with a specific parent phase ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder",
                            "startdate",
                            "duedate"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Phases modified on or after this date (UTC). ISO8601 or relative (12h, 5d, 2w, 1m)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Phases modified on or before this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectPhaseListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Add a Phase (Item Collection) to a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Project Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateProjectPhasePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/phases/{phaseid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single project phase (item collection) by ID. Includes all financial, time, billing, and progress fields.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectPhaseGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing project phase.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Phase update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateProjectPhasePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-deletes a project phase and its associated items.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Delete Project Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/projectnotes": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Project Notes for a Project based on the specified filters.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Project Notes",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "title,content",
                        "description": "Comma-separated fields to return. Available: title, content, project, company, lastmodified, all",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "website",
                        "description": "Search by title. Use ! prefix for negation.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Notes with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Notes with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "List of Note IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "title"
                        ],
                        "type": "string",
                        "default": "id",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectNoteListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a Project Note for a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Project Project Note",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectNoteCreatePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/projectnotes/{noteid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Project Note for a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Project Note",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Note ID",
                        "name": "noteid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectnoteGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a Project Note for a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project Project Note",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Note ID",
                        "name": "noteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectNoteUpdatePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Deletes a Project Note from a Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Delete Project Project Note",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Note ID",
                        "name": "noteid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/quotes": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Quotes for a Project based on the specified filters.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Quotes",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "number,title,company,status,totals,quoteddate",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by number or title. Use ! prefix for negation.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by quote number. Supports ! for negation.",
                        "name": "searchnumber",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by quote title. Supports ! for negation.",
                        "name": "searchtitle",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "pending",
                            "sent",
                            "accepted",
                            "addedtoproject",
                            "declined",
                            "expired",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Quote status",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "estimate",
                            "quote",
                            "all"
                        ],
                        "type": "string",
                        "description": "Quote type",
                        "name": "type",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by taxable status",
                        "name": "taxable",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project manager Contact IDs (comma-separated)",
                        "name": "managerid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project category IDs (comma-separated)",
                        "name": "projectcategoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quoted date from (ISO8601 or relative: 12h, 5d, 2w, 1m)",
                        "name": "quoteddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quoted date to (ISO8601 or relative)",
                        "name": "quoteddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Approved date from (ISO8601 or relative)",
                        "name": "approveddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Approved date to (ISO8601 or relative)",
                        "name": "approveddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Valid to date from (ISO8601 or relative)",
                        "name": "validtodatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Valid to date to (ISO8601 or relative)",
                        "name": "validtodateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total minimum",
                        "name": "grandtotalfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total maximum",
                        "name": "grandtotalto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "company",
                            "project",
                            "status",
                            "day",
                            "week",
                            "month",
                            "year"
                        ],
                        "type": "string",
                        "description": "Group results by. Returns subtotals per group.",
                        "name": "subtotals",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "quoted",
                            "approved"
                        ],
                        "type": "string",
                        "description": "Date field for subtotals grouping",
                        "name": "subtotalsdateoption",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quotes modified on or after this date (UTC, ISO8601 or relative)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quotes modified on or before this date (UTC, ISO8601 or relative)",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quotes with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quotes with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Quote IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "number",
                            "title",
                            "quoteddate",
                            "validtodate",
                            "companyname"
                        ],
                        "type": "string",
                        "default": "number",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuoteListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/reactivate": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Reactivates a Project. Note: this does not reactivate Tasks within the Project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Reactivate Project",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/settings": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the settings for a single Project, including client access, task visibility, and notification preferences.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Settings",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectSettingsGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates the settings for a Project, including client access, task visibility, and notification preferences.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project Settings",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateProjectSettingsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/time": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Time Records for a Project based on the specified filters. Unlike GET /time, no default date range is applied — all time for the project is returned unless trackedfrom/trackedto are specified.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Time Records",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "contact,item,dates,timetracked",
                        "description": "Comma-separated fields to return. Available: contact, item, project, company, dates, timetracked, notes, billable, lastmodified, all",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "Contact filter. Comma-separated Contact IDs, 'me', or 'all'",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Item ID or list of Item IDs (comma-separated)",
                        "name": "itemid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Company ID or list of Company IDs (comma-separated)",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Project Category ID or list of Category IDs (comma-separated)",
                        "name": "categoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "-6d",
                        "description": "Time tracked on or after this date. Accepts yyyy-mm-dd or relative: -6d, -1w, -1m, -1y",
                        "name": "trackedfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "+0d",
                        "description": "Time tracked on or before this date. Accepts yyyy-mm-dd or relative: +0d, +1w",
                        "name": "trackedto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "billable",
                            "nonbillable",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Billable filter",
                        "name": "billable",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Filter by item activeworkstate",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by notes. Use ! prefix for negation.",
                        "name": "searchnotes",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by item name. Use ! prefix for negation.",
                        "name": "searchitem",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or after this date (UTC, ISO8601 or relative)",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or before this date (UTC, ISO8601 or relative)",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Time Record IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "date",
                            "itemid"
                        ],
                        "type": "string",
                        "default": "id",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TimeListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/timeallocation": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Time Allocations for a Project based on the specified filters.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Time Allocations",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "contact,item,project,time",
                        "description": "Comma-separated fields to return. Available: contact, item, project, time, labour, all",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Contact ID or list of Contact IDs (comma-separated)",
                        "name": "contactid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Item ID or list of Item IDs (comma-separated)",
                        "name": "itemid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "default": "active",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Allocations with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Allocations with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "List of Time Allocation IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "contactid",
                            "itemid"
                        ],
                        "type": "string",
                        "default": "id",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TimeAllocationListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/workstage": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Sets the active work stage for a project.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project Work Stage",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Work stage",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateProjectWorkStageRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/projects/{projectid}/workstages": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the workstage history for a project. Access is contact-filtered based on the authenticated user's project membership.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Workstage History",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project ID",
                        "name": "projectid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "enum": [
                            "setdatetime",
                            "id"
                        ],
                        "type": "string",
                        "default": "setdatetime",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "desc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectWorkStageHistoryListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Quotes based on the filters specified. Optionally returns subtotals grouped by company, project, status, or time period.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Get Quotes",
                "parameters": [
                    {
                        "type": "string",
                        "default": "number,title,company,status,totals,quoteddate",
                        "description": "Comma-separated list of fields to return. Available fields: \u003cul\u003e\u003cli\u003e\u003cb\u003enumber\u003c/b\u003e - Quote number\u003c/li\u003e\u003cli\u003e\u003cb\u003etitle\u003c/b\u003e - Quote title\u003c/li\u003e\u003cli\u003e\u003cb\u003estatus\u003c/b\u003e - Work state\u003c/li\u003e\u003cli\u003e\u003cb\u003eactiveworkstageid\u003c/b\u003e - Active work stage ID\u003c/li\u003e\u003cli\u003e\u003cb\u003etype\u003c/b\u003e - Quote type (estimate or quote)\u003c/li\u003e\u003cli\u003e\u003cb\u003edescription\u003c/b\u003e - Quote description (HTML stripped)\u003c/li\u003e\u003cli\u003e\u003cb\u003ecompany\u003c/b\u003e - Company ID and name\u003c/li\u003e\u003cli\u003e\u003cb\u003eclientcontactname\u003c/b\u003e - Client contact name\u003c/li\u003e\u003cli\u003e\u003cb\u003eproject\u003c/b\u003e - Project ID\u003c/li\u003e\u003cli\u003e\u003cb\u003edates\u003c/b\u003e - Quote date, valid date, approved date\u003c/li\u003e\u003cli\u003e\u003cb\u003equotedate\u003c/b\u003e - Quote date only\u003c/li\u003e\u003cli\u003e\u003cb\u003evaliddate\u003c/b\u003e - Valid date only\u003c/li\u003e\u003cli\u003e\u003cb\u003eapproveddate\u003c/b\u003e - Approved date only\u003c/li\u003e\u003cli\u003e\u003cb\u003eemaileddate\u003c/b\u003e - Date quote was emailed\u003c/li\u003e\u003cli\u003e\u003cb\u003eemailedtoclient\u003c/b\u003e - Whether quote was emailed to client\u003c/li\u003e\u003cli\u003e\u003cb\u003eemailedto\u003c/b\u003e - Email address quote was sent to\u003c/li\u003e\u003cli\u003e\u003cb\u003eshowcostbreakdown\u003c/b\u003e - Whether cost breakdown is shown\u003c/li\u003e\u003cli\u003e\u003cb\u003eshowitemdescription\u003c/b\u003e - Whether item description is shown\u003c/li\u003e\u003cli\u003e\u003cb\u003eshowphases\u003c/b\u003e - Whether phases are shown\u003c/li\u003e\u003cli\u003e\u003cb\u003equotedby\u003c/b\u003e - Contact ID who created the quote\u003c/li\u003e\u003cli\u003e\u003cb\u003etotals\u003c/b\u003e - Subtotal, tax total, and grand total\u003c/li\u003e\u003cli\u003e\u003cb\u003ebudget\u003c/b\u003e - Budget amount, tax, and type\u003c/li\u003e\u003cli\u003e\u003cb\u003ebillamount\u003c/b\u003e - Bill amount, tax, and type\u003c/li\u003e\u003cli\u003e\u003cb\u003etaxable\u003c/b\u003e - Whether quote is taxable\u003c/li\u003e\u003cli\u003e\u003cb\u003etaxrate\u003c/b\u003e - Tax rate percentage\u003c/li\u003e\u003cli\u003e\u003cb\u003eaddress\u003c/b\u003e - Address fields\u003c/li\u003e\u003cli\u003e\u003cb\u003epagetitle\u003c/b\u003e - Page title\u003c/li\u003e\u003cli\u003e\u003cb\u003ecustomfield\u003c/b\u003e - Custom field name and value\u003c/li\u003e\u003cli\u003e\u003cb\u003elastmodified\u003c/b\u003e - Last modified date (UTC)\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - All fields listed above\u003c/li\u003e\u003c/ul\u003e\u003cbr\u003eSub-entity fields (NOT included by \u003cb\u003eall\u003c/b\u003e — must be named explicitly, e.g. \u003ccode\u003efields=all,phases\u003c/code\u003e):\u003cul\u003e\u003cli\u003e\u003cb\u003ephases\u003c/b\u003e - Phase line items with nested items\u003c/li\u003e\u003c/ul\u003e",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use number, title, or q+qfields instead. Search by number or title. Use ! for negation.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use number or q+qfields instead. Search by quote number. Supports ! for negation.",
                        "name": "searchnumber",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Deprecated: use title or q+qfields instead. Search by quote title. Supports ! for negation.",
                        "name": "searchtitle",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact number match",
                        "name": "number",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact title match",
                        "name": "title",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Fuzzy search term (use with qfields to restrict fields searched)",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "number",
                            "title"
                        ],
                        "type": "string",
                        "description": "Comma-separated fields to fuzzy search",
                        "name": "qfields",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "pending",
                            "sent",
                            "accepted",
                            "addedtoproject",
                            "declined",
                            "expired",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Status (activeworkstate). Alias: activeworkstate.",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "pending",
                            "sent",
                            "accepted",
                            "addedtoproject",
                            "declined",
                            "expired",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Alias for status.",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "estimate",
                            "quote",
                            "all"
                        ],
                        "type": "string",
                        "description": "Quote type",
                        "name": "type",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "true",
                            "false",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by taxable status",
                        "name": "taxable",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project manager Contact IDs (comma-separated)",
                        "name": "managerid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project category IDs (comma-separated)",
                        "name": "projectcategoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Company IDs (comma-separated)",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter quotes by active work stage ID",
                        "name": "workstageid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quoted date from (ISO8601 or relative: 12h, 5d, 2w, 1m)",
                        "name": "quoteddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quoted date to (ISO8601 or relative)",
                        "name": "quoteddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Approved date from (ISO8601 or relative)",
                        "name": "approveddatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Approved date to (ISO8601 or relative)",
                        "name": "approveddateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Valid to date from (ISO8601 or relative)",
                        "name": "validtodatefrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Valid to date to (ISO8601 or relative)",
                        "name": "validtodateto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total minimum",
                        "name": "grandtotalfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Grand total maximum",
                        "name": "grandtotalto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "company",
                            "project",
                            "status",
                            "day",
                            "week",
                            "month",
                            "year"
                        ],
                        "type": "string",
                        "description": "Group results by. Returns subtotals per group.",
                        "name": "subtotals",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "quoted",
                            "approved"
                        ],
                        "type": "string",
                        "description": "Date field for subtotals grouping",
                        "name": "subtotalsdateoption",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quotes modified on or after this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quotes modified on or before this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quotes with ID greater than or equal to this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quotes with ID less than or equal to this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Quote IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "number",
                            "title",
                            "quotedate",
                            "validdate",
                            "companyname"
                        ],
                        "type": "string",
                        "default": "number",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuoteListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates one or more quotes by ID. All fields except ids are optional — only provided fields are updated.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Bulk Update Quotes",
                "parameters": [
                    {
                        "description": "Quote IDs and fields to update",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkUpdateQuotesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new (blank) quote.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Create Quote",
                "parameters": [
                    {
                        "description": "Quote data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateQuotePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes one or more quotes by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Bulk Delete Quotes",
                "parameters": [
                    {
                        "description": "Quote IDs to delete",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkDeleteQuotesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/items": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of all quote line items across all quotes, based on the filters specified.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Get Quote Items",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,itemcollectionid,parentid,itemtypeid,activeworkstate,billAmount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by item name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Quote ID or list of Quote IDs (comma-separated)",
                        "name": "quoteid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to items within a specific phase (itemcollectionid)",
                        "name": "phaseid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter by parent item ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter by item type ID",
                        "name": "itemtypeid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuoteItemListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates one or more quote items by ID. All fields except ids are optional — only provided fields are updated.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Bulk Update Quote Items",
                "parameters": [
                    {
                        "description": "Item IDs and fields to update",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkUpdateItemsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more quote line items. The quoteid must be provided in the request body.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Create Quote Items",
                "parameters": [
                    {
                        "description": "Item data (single object or array)",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateQuoteItemPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/items/{itemid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single quote line item by ID, without requiring the quote ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Get Quote Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuoteItemGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing quote line item by ID, without requiring the quote ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Update Quote Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Item update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateQuoteItemPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-deletes a quote line item by ID, without requiring the quote ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Delete Quote Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/items/{itemid}/order": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Moves a quote item before or after another item using sortorder. Provide exactly one of placeafterid or placebeforeid.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Reorder Quote Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Order placement",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateQuoteItemOrderRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/phases": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns phases (item collections) across all quotes. Optionally filter by one or more quote IDs.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Get Quote Phases",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,quoteid,parentid,billAmount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by phase name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Quote ID or comma-separated list of Quote IDs to filter by",
                        "name": "quoteid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to phases with a specific parent phase ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuotePhaseListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates one or more quote phases by ID. All fields except ids are optional.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Bulk Update Quote Phases",
                "parameters": [
                    {
                        "description": "Phase IDs and fields to update",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkUpdatePhasesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more quote phases (item collections). The quoteid must be included in the request body.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Create Quote Phases",
                "parameters": [
                    {
                        "description": "Phase data (single object or array)",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateQuotePhasePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/phases/adjustdates": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Shifts item dates within one or more quote phases by a number of days. Negative values shift backwards.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Bulk Adjust Quote Phase Dates",
                "parameters": [
                    {
                        "description": "Phase IDs and day offset",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BulkAdjustPhaseDatesPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/phases/{phaseid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single quote phase by ID. Looks up the phase by ID alone.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Get Quote Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuotePhaseGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing quote phase by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Update Quote Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Phase update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateQuotePhasePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-deletes a quote phase by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Delete Quote Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/{quoteid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "View a single Quote. Returns detailed information including phases and line items. IMPORTANT: For Task/Staff Rate Lines, the 'rate' value is cost/hour, the 'time' value is the time in minutes.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Get Quote",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuoteGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing quote. Only provide the fields you want to update.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Update Quote",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Quote update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateQuotePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a quote by setting activeworkstate to 'deleted'.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Delete Quote",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/{quoteid}/clone": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Clones an existing quote.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Clone Quote",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID to clone",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Clone options",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CloneQuoteInvoiceRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/{quoteid}/items": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of line items for a quote. Supports field selection, filtering, sorting and pagination.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Get Quote Items",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "id,name,itemcollectionid,parentid,itemtypeid,activeworkstate,billAmount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by item name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to items within a specific phase (itemcollectionid)",
                        "name": "phaseid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter by parent item ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter by item type ID",
                        "name": "itemtypeid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuoteItemListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more line items within a quote phase.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Create Quote Items",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Item data (single object or array)",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateQuoteItemPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/{quoteid}/items/{itemid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single quote line item by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Get Quote Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuoteItemGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing quote line item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Update Quote Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Item update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateQuoteItemPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-deletes a quote line item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Delete Quote Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/{quoteid}/items/{itemid}/workstages": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the workstage history for a quote line item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Get Quote Item Workstage History",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "enum": [
                            "setdatetime",
                            "id"
                        ],
                        "type": "string",
                        "default": "setdatetime",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "desc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ItemWorkStageHistoryListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/{quoteid}/order": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Moves a quote before or after another quote using sortorder. Provide exactly one of placeafterid or placebeforeid.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Reorder Quote",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Order placement",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateQuoteOrderRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/{quoteid}/phases": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of phases (item collections) for a quote.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Get Quote Phases",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "id,name,quoteid,parentid,billAmount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by phase name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to phases with a specific parent phase ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuotePhaseListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more phases (item collections) within a quote.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Create Quote Phases",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Phase data (single object or array)",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateQuotePhasePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/{quoteid}/phases/{phaseid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single quote phase (item collection) by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Get Quote Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuotePhaseGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing quote phase.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Update Quote Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Phase update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateQuotePhasePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-deletes a quote phase and its associated items.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Delete Quote Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/{quoteid}/workstage": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Sets the active work stage for a quote.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Update Quote Work Stage",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Work stage",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateQuoteWorkStageRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quotes/{quoteid}/workstages": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the workstage history for a quote.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quotes"
                ],
                "summary": "Get Quote Workstage History",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Quote ID",
                        "name": "quoteid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "enum": [
                            "setdatetime",
                            "id"
                        ],
                        "type": "string",
                        "default": "setdatetime",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "desc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuoteWorkStageHistoryListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/account": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns Account settings, including plan details, plugin status, currency, project variable, time and look \u0026amp; feel.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Account Settings",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.settingsAccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/account/license": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of the available, used and total licenses.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Account License Details",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.LicenseGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/account/looknfeel": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns Look \u0026amp; Feel Settings including logo and color scheme.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Look \u0026 Feel Settings",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.LooknfeelListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/account/plan": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of the Plan (Professional/Advanced) and plugin status (invoicesplugin/quotesplugin) for the account.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Account Plan",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.settingsAccountPlanResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/contacts/divisions": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Divisions. Advanced plan only.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Divisions",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.DivisionListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/contacts/divisions/{divisionid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Division. Advanced plan only.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Division",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Division ID",
                        "name": "divisionid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.DivisionGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a division. Advanced plan only.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Update Division",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Division ID",
                        "name": "divisionid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Division update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateDivisionPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/contacts/groups": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Groups including Contacts in each Group.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Groups",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactGroupListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new contact group.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Create Group",
                "parameters": [
                    {
                        "description": "Group data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateGroupPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/contacts/groups/{groupid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Group including the Contacts in the Group.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Group",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Group ID",
                        "name": "groupid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactGroupGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a group.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Update Group",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Group ID",
                        "name": "groupid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Group update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateGroupPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Deletes a group.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Delete Group",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Group ID",
                        "name": "groupid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/contacts/permissions": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of available Permissions in ProWorkflow.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Permissions",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PermissionSettingsListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/contacts/roles": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Roles including assigned Contacts.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Roles",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RoleListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new role.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Create Role",
                "parameters": [
                    {
                        "description": "Role data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateRolePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/contacts/roles/{roleid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Role including assigned Contacts.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Role",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Role ID",
                        "name": "roleid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RoleGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a role's name, color, display order, permissions, and/or assigned contacts.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Update Role",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Role ID",
                        "name": "roleid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Role update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateRolePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Deletes a role.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Delete Role",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Role ID",
                        "name": "roleid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/contacts/tags": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Contact/Company Tags.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Contact/Company Tags",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactTagListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new Contact/Company Tag.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Create Contact Tag",
                "parameters": [
                    {
                        "description": "Contact tag data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateContactTagPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/contacts/tags/{tagid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Contact Tag.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Contact Tag",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Tag ID",
                        "name": "tagid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactTagGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a Contact Tag.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Update Contact Tag",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Tag ID",
                        "name": "tagid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Contact tag update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateContactTagPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a Contact Tag.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Delete Contact Tag",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Tag ID",
                        "name": "tagid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/contacts/teams": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Teams including the Groups in each Team.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Teams",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,code,groupid",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by team name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TeamListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new team.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Create Team",
                "parameters": [
                    {
                        "description": "Team data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateTeamPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/contacts/teams/{teamid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Team including the Groups in the Team.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Team",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Team ID",
                        "name": "teamid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TeamGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a team.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Update Team",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Team ID",
                        "name": "teamid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Team update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateTeamPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Deletes a team.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Delete Team",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Team ID",
                        "name": "teamid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/invoices/autonumbering": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the Invoices Autonumbering settings including mask, count, and placeholder.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Invoices Autonumbering Settings",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.SettingsInvoicesAutonumberingListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/invoices/templates": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a simple list of Invoice Templates.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "invoices"
                ],
                "summary": "Get Invoice Templates",
                "parameters": [
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceTemplateListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/invoices/templates/{templateid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns detailed information about a single Invoice Template, including phases and line items.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Invoice Template",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Template ID",
                        "name": "templateid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InvoiceGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/items/categories": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Item Categories.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Item Categories",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,color,sortorder,lastmodifiedutc",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by category name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ItemCategoryListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new Item Category.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Create Item Category",
                "parameters": [
                    {
                        "description": "Item category data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateItemCategoryPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/items/categories/{categoryid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Item Category.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Item Category",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Category ID",
                        "name": "categoryid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ItemCategoryGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an Item Category.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Update Item Category",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Category ID",
                        "name": "categoryid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Item category update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateItemCategoryPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes an Item Category.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Delete Item Category",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Category ID",
                        "name": "categoryid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/items/tags": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Item Tags.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Item Tags",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ItemTagListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new Item Tag.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Create Item Tag",
                "parameters": [
                    {
                        "description": "Item tag data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateItemTagPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/items/tags/items": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds one or more Items (Tasks) to one or more Task Tags.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Add Items to Tags",
                "parameters": [
                    {
                        "description": "Tag IDs and Item IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ItemsToTagsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Removes one or more Items (Tasks) from one or more Task Tags.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Remove Items from Tags",
                "parameters": [
                    {
                        "description": "Tag IDs and Item IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ItemsToTagsPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/items/tags/{tagid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Item Tag.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Item Tag",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Tag ID",
                        "name": "tagid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ItemTagGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an Item Tag.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Update Item Tag",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Tag ID",
                        "name": "tagid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Item tag update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateItemTagPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes an Item Tag.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Delete Item Tag",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Tag ID",
                        "name": "tagid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/product/fixedprice": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of products from the Fixed Price Library. These are products charged at a set price per unit (ItemType hasLabour=0, hasQuantity=1). Price fields (inUnitPrice, outUnitPrice) are excluded for security.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Fixed Price Library",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.SettingsProductFixedpriceListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/product/goodservice": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of products from the Goods and Services Library. These are products charged with both a set price and an hourly rate (ItemType hasLabour=1, hasQuantity=1). Price fields (inUnitPrice, outUnitPrice) are excluded for security.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Goods and Services Library",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.SettingsProductGoodserviceListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/product/hourlyservice": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of products from the Hourly Services Library. These are products charged at an hourly rate (ItemType hasLabour=1, hasQuantity=0). Price fields (inUnitPrice, outUnitPrice) are excluded for security.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Hourly Services Library",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.SettingsProductHourlyserviceListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns default Project settings. These can be changed from the main ProWorkflow application.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Project Settings",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.SettingsProjectsListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/autonumbering": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the Projects Autonumbering settings including mask, count, and placeholder.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Projects Autonumbering Settings",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.SettingsProjectsAutonumberingListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/categories": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Project Categories.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Project Categories",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,color,sortorder,lastmodifiedutc,projectcount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by category name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectCategoryListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new Project Category.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Create Project Category",
                "parameters": [
                    {
                        "description": "Project category data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateProjectCategoryPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/categories/{categoryid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Project Category.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Project Category",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Category ID",
                        "name": "categoryid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectCategoryGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a Project Category.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Update Project Category",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Category ID",
                        "name": "categoryid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Project category update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateProjectCategoryPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a Project Category.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Delete Project Category",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Category ID",
                        "name": "categoryid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/customfieldoptions": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new option for a Project Custom Field.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Project Custom Field Option",
                "parameters": [
                    {
                        "description": "Custom field option data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateCustomFieldOptionPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/customfieldoptions/{optionid}": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an option for a Project Custom Field.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project Custom Field Option",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Custom Field Option ID",
                        "name": "optionid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Custom field option update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateCustomFieldOptionPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Deletes an option for a Project Custom Field.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Delete Project Custom Field Option",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Custom Field Option ID",
                        "name": "optionid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/customfields": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Custom Fields including the Options for each Field. Advanced plan only.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Custom Fields",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CustomFieldListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new Project Custom Field.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Create Project Custom Field",
                "parameters": [
                    {
                        "description": "Custom field data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateCustomFieldPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/customfields/{customfieldid}": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a Project Custom Field.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Update Project Custom Field",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Custom Field ID",
                        "name": "customfieldid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Custom field update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateCustomFieldPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Deletes a Project Custom Field.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Delete Project Custom Field",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Custom Field ID",
                        "name": "customfieldid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/tags": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Project Tags.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Project Tags",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,color,lastmodifiedutc",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by tag name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectTagListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new Project Tag.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Create Project Tag",
                "parameters": [
                    {
                        "description": "Project tag data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateProjectTagPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/tags/{tagid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Project Tag.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Project Tag",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Tag ID",
                        "name": "tagid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectTagGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a Project Tag.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Update Project Tag",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Tag ID",
                        "name": "tagid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Project tag update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateProjectTagPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a Project Tag.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Delete Project Tag",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Tag ID",
                        "name": "tagid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/templates": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Project Templates. Advanced plan only.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "projects"
                ],
                "summary": "Get Project Templates",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectTemplateListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/templates/{projecttemplateid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns detailed information about a single Project Template, including tasks.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Project Template",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project Template ID",
                        "name": "projecttemplateid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ProjectGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/templates/{projecttemplateid}/items": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns line items for a specific project template.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Template Items by Template",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project Template ID",
                        "name": "projecttemplateid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "id,name,itemcollectionid,parentid,itemtypeid,activeworkstate",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by item name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to items within a specific phase (itemcollectionid)",
                        "name": "phaseid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter by parent item ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter by item type ID",
                        "name": "itemtypeid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TemplateItemListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/templates/{projecttemplateid}/phases": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns phases (item collections) for a specific project template.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Template Phases by Template",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project Template ID",
                        "name": "projecttemplateid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "default": "id,name,itemcollectiontemplateid,parentid,billAmount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by phase name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to phases with a specific parent phase ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TemplatePhaseListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds a Phase (Item Collection) to a specific project template.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Create Template Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project Template ID",
                        "name": "projecttemplateid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateTemplatePhaseForTemplatePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/projects/templates/{projecttemplateid}/phases/{phaseid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single template phase (item collection) by ID within a specific template.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Template Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project Template ID",
                        "name": "projecttemplateid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TemplatePhaseGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing template phase within a specific project template.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Update Template Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Project Template ID",
                        "name": "projecttemplateid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Phase update data",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.TemplatePhaseUpdatePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/quotes": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns default Quote settings. These can be changed from the main ProWorkflow application.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Quote Settings",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.SettingsQuotesListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/quotes/autonumbering": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the Quotes Autonumbering settings including mask, count, and placeholder.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Quotes Autonumbering Settings",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.SettingsQuotesAutonumberingListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/quotes/templates": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Quote Templates.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Quote Templates",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuoteTemplateListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/quotes/templates/{templateid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns detailed information about a single Quote Template, including phases and line items.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Quote Template",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Template ID",
                        "name": "templateid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.QuoteGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/servicerates": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Hourly Rate Services (service rates). Price fields (inLabourPrice, outLabourPrice, outLabourPriceMultiplier) are excluded for security.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Hourly Rate Services",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ServiceRateListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/staffrates": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of staff members with their default hourly rate service and sell rate. Pay rate and cost rate fields are excluded for security. In v3 this was available at /settings/quotes/staffrates and /settings/invoices/staffrates — those are now consolidated here.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Staff Rates",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StaffRateListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/webhooks": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of active Webhook subscriptions for the account.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Webhooks",
                "parameters": [
                    {
                        "enum": [
                            "all",
                            "newcontact",
                            "newpendingcontact",
                            "editcontact",
                            "editcontactlocation",
                            "deletecontact",
                            "newcompany",
                            "newpendingcompany",
                            "editcompany",
                            "deletecompany",
                            "newfile",
                            "deletefile",
                            "newinvoice",
                            "editinvoice",
                            "deleteinvoice",
                            "newmessage",
                            "editmessage",
                            "deletemessage",
                            "newproject",
                            "editproject",
                            "editstageproject",
                            "deleteproject",
                            "completeproject",
                            "restoreProject",
                            "newprojectrequest",
                            "editprojectrequest",
                            "deleteprojectrequest",
                            "approveprojectrequest",
                            "declineprojectrequest",
                            "newquote",
                            "editquote",
                            "deletequote",
                            "newsharednote",
                            "editsharednote",
                            "deletesharednote",
                            "newtask",
                            "edittask",
                            "deletetask",
                            "completetask",
                            "reactivatetask",
                            "newtime",
                            "edittime",
                            "deletetime",
                            "starttimer",
                            "stoptimer",
                            "unknown"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Event type filter",
                        "name": "event",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ResthookListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates a new Webhook subscription.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Create Webhook",
                "parameters": [
                    {
                        "description": "Webhook subscription data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateResthookPayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/webhooks/requests": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Webhook delivery requests for debugging. Requests older than 7 days are automatically deleted.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Webhook Requests",
                "parameters": [
                    {
                        "enum": [
                            "all",
                            "company",
                            "contact",
                            "file",
                            "invoice",
                            "message",
                            "project",
                            "projectrequest",
                            "quote",
                            "sharednote",
                            "task",
                            "time",
                            "timer"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Event type filter",
                        "name": "event",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Web Hook ID or comma-separated list of IDs",
                        "name": "resthookid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "pending",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "default": "pending",
                        "description": "Request status filter",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ResthookRequestListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/webhooks/{webhookid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Webhook subscription.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Webhook",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Webhook ID",
                        "name": "webhookid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates a Webhook subscription.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Update Webhook",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Webhook ID",
                        "name": "webhookid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Webhook update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateResthookPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft deletes a Webhook subscription.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Delete Webhook",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Webhook ID",
                        "name": "webhookid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/workstages": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Work Stages. Use the type parameter to filter by stage type.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Work Stages",
                "parameters": [
                    {
                        "enum": [
                            "item",
                            "project",
                            "quote",
                            "invoice"
                        ],
                        "type": "string",
                        "description": "Filter by work stage type",
                        "name": "type",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "active",
                        "description": "Filter by work state (exact match)",
                        "name": "workstate",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.WorkStageListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/workstages/invoice": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Work Stages for type 'invoice'",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Invoice Work Stages",
                "parameters": [
                    {
                        "type": "string",
                        "example": "active",
                        "description": "Filter by work state (exact match)",
                        "name": "workstate",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.WorkStageListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/workstages/item": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Work Stages for type 'item'",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Item Work Stages",
                "parameters": [
                    {
                        "type": "string",
                        "example": "active",
                        "description": "Filter by work state (exact match)",
                        "name": "workstate",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.WorkStageListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/workstages/project": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Work Stages for type 'project'",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Project Work Stages",
                "parameters": [
                    {
                        "type": "string",
                        "example": "active",
                        "description": "Filter by work state (exact match)",
                        "name": "workstate",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.WorkStageListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/settings/workstages/quote": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Work Stages for type 'quote'",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Quote Work Stages",
                "parameters": [
                    {
                        "type": "string",
                        "example": "active",
                        "description": "Filter by work state (exact match)",
                        "name": "workstate",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.WorkStageListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/templateitems": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of all template line items across all templates, based on the filters specified.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Template Items",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,itemcollectionid,parentid,itemtypeid,activeworkstate",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by item name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "Template ID or list of Template IDs (comma-separated)",
                        "name": "templateid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to items within a specific phase (itemcollectionid)",
                        "name": "phaseid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter by parent item ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter by item type ID",
                        "name": "itemtypeid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TemplateItemListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/templateitems/{itemid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single template item by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Template Item",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Template Item ID",
                        "name": "itemid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TemplateItemGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/templatephases": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of all template phases (item collections) across all templates.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Template Phases",
                "parameters": [
                    {
                        "type": "string",
                        "default": "id,name,itemcollectiontemplateid,parentid,billAmount",
                        "description": "Comma-separated fields to return, or 'all'",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by phase name. Prefix with ! to negate.",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Template ID or comma-separated list of Template IDs",
                        "name": "templateid",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Filter to phases with a specific parent phase ID (0 = top-level only)",
                        "name": "parentid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "name",
                            "sortorder"
                        ],
                        "type": "string",
                        "default": "sortorder",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort direction",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TemplatePhaseListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Adds a Phase (Item Collection) to a template.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Create Template Phase",
                "parameters": [
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.TemplatePhaseCreatePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/templatephases/{phaseid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns full details of a single template phase (item collection) by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Get Template Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TemplatePhaseGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing template phase.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "settings"
                ],
                "summary": "Update Template Phase",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Phase ID",
                        "name": "phaseid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Phase update data",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.TemplatePhaseUpdatePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/time": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Time Records based on the filters specified. By default returns time tracked in the last 6 days. The fields parameter controls which data is returned for each record.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "time"
                ],
                "summary": "Get Time Records",
                "parameters": [
                    {
                        "type": "string",
                        "default": "contact,item,dates,timetracked",
                        "description": "Comma-separated list of fields to return. Available fields: \u003cul\u003e\u003cli\u003e\u003cb\u003econtact\u003c/b\u003e - Contact ID and name\u003c/li\u003e\u003cli\u003e\u003cb\u003eitem\u003c/b\u003e (or \u003cb\u003etask\u003c/b\u003e) - Item ID and name\u003c/li\u003e\u003cli\u003e\u003cb\u003eitemid\u003c/b\u003e (or \u003cb\u003etaskid\u003c/b\u003e) - Item ID only\u003c/li\u003e\u003cli\u003e\u003cb\u003eitemname\u003c/b\u003e (or \u003cb\u003etaskname\u003c/b\u003e) - Item name only\u003c/li\u003e\u003cli\u003e\u003cb\u003eproject\u003c/b\u003e - Project ID, title, and number\u003c/li\u003e\u003cli\u003e\u003cb\u003ecompany\u003c/b\u003e - Company ID and name\u003c/li\u003e\u003cli\u003e\u003cb\u003edates\u003c/b\u003e - Start date, start time, end time\u003c/li\u003e\u003cli\u003e\u003cb\u003etimetracked\u003c/b\u003e - Time spent (in minutes)\u003c/li\u003e\u003cli\u003e\u003cb\u003enotes\u003c/b\u003e - Time record notes\u003c/li\u003e\u003cli\u003e\u003cb\u003ebillable\u003c/b\u003e - Billable flag (from item)\u003c/li\u003e\u003cli\u003e\u003cb\u003eaccountedfor\u003c/b\u003e - Accounted for flag\u003c/li\u003e\u003cli\u003e\u003cb\u003etimeallocationid\u003c/b\u003e - Time allocation ID\u003c/li\u003e\u003cli\u003e\u003cb\u003eitemcollectionid\u003c/b\u003e - Item collection (phase) ID\u003c/li\u003e\u003cli\u003e\u003cb\u003elastmodified\u003c/b\u003e - Last modified date (UTC)\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - All fields\u003c/li\u003e\u003c/ul\u003e",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Contact filter. \u003cul\u003e\u003cli\u003e\u003cb\u003econtactid/s\u003c/b\u003e - Time tracked by specified contacts\u003cbr\u003eExample: 1,2,3\u003c/li\u003e\u003cli\u003e\u003cb\u003eme\u003c/b\u003e - Time tracked by requesting user\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - All contacts (default)\u003c/li\u003e\u003c/ul\u003e",
                        "name": "contacts",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project ID or list of Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Item (task) ID or list of IDs (comma-separated). Alias: taskid",
                        "name": "itemid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Alias for itemid parameter.",
                        "name": "taskid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Company ID or list of Company IDs (comma-separated)",
                        "name": "companyid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Project Category ID or list of Category IDs (comma-separated)",
                        "name": "categoryid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "-6d",
                        "description": "Time tracked on or after this date. Accepts yyyy-mm-dd or relative: -6d, -1w, -1m, -1y. Default: -6d",
                        "name": "trackedfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "+0d",
                        "description": "Time tracked on or before this date. Accepts yyyy-mm-dd or relative: +0d, +1w. Default: +0d",
                        "name": "trackedto",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "billable",
                            "nonbillable",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Billable filter. \u003cul\u003e\u003cli\u003e\u003cb\u003ebillable\u003c/b\u003e - Billable time only\u003c/li\u003e\u003cli\u003e\u003cb\u003enonbillable\u003c/b\u003e - Non-billable time only\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - All time (default)\u003c/li\u003e\u003c/ul\u003e",
                        "name": "billable",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Filter by project status (activeworkstate). \u003cul\u003e\u003cli\u003e\u003cb\u003eactive\u003c/b\u003e - Active projects only\u003c/li\u003e\u003cli\u003e\u003cb\u003ecomplete\u003c/b\u003e - Completed projects only\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - All projects (default)\u003c/li\u003e\u003c/ul\u003e",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "default": "all",
                        "description": "Filter by item activeworkstate. \u003cul\u003e\u003cli\u003e\u003cb\u003eactive\u003c/b\u003e - Active items only\u003c/li\u003e\u003cli\u003e\u003cb\u003ecomplete\u003c/b\u003e - Completed items only\u003c/li\u003e\u003cli\u003e\u003cb\u003edeleted\u003c/b\u003e - Deleted items only\u003c/li\u003e\u003cli\u003e\u003cb\u003eall\u003c/b\u003e - All items (default)\u003c/li\u003e\u003c/ul\u003e",
                        "name": "activeworkstate",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "deleted",
                            "all"
                        ],
                        "type": "string",
                        "description": "Alias for activeworkstate parameter.",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by notes. \u003cul\u003e\u003cli\u003e\u003cb\u003estring\u003c/b\u003e - Records where Notes contains string\u003c/li\u003e\u003cli\u003e\u003cb\u003e!string\u003c/b\u003e - Records where Notes does not contain string\u003c/li\u003e\u003c/ul\u003e",
                        "name": "searchnotes",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by item name. \u003cul\u003e\u003cli\u003e\u003cb\u003estring\u003c/b\u003e - Records where Item Name contains string\u003c/li\u003e\u003cli\u003e\u003cb\u003e!string\u003c/b\u003e - Records where Item Name does not contain string\u003c/li\u003e\u003c/ul\u003e",
                        "name": "searchitem",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or after this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records modified on or before this date (UTC). ISO8601 or relative",
                        "name": "lastmodifiedutcto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records with ID greater than or equal to this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Records with ID less than or equal to this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "List of Time Record IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "date",
                            "projectid",
                            "itemid",
                            "taskid"
                        ],
                        "type": "string",
                        "default": "id",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page Number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page Size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TimeListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Create a new Time Record. Tracks time spent on an item by a contact.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "time"
                ],
                "summary": "Add Time Record",
                "parameters": [
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.TimeCreatePayload"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/time/contact": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Reassigns the contact on one or more time log entries.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "time"
                ],
                "summary": "Update Time Log Contact",
                "parameters": [
                    {
                        "description": "Time log IDs and new contact",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateTimelogContactRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/time/invoice": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates the invoice item association on one or more time log entries.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "time"
                ],
                "summary": "Update Time Log Invoice Item",
                "parameters": [
                    {
                        "description": "Time log IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateTimelogInvoiceItemRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/time/rate": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Reassigns the hourly rate service on one or more time log entries.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "time"
                ],
                "summary": "Update Time Log Rate",
                "parameters": [
                    {
                        "description": "Time log IDs and new hourly rate service",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateTimelogRateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/time/start": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Starts a running timer for the authenticated user against an item.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "time"
                ],
                "summary": "Start Timer",
                "parameters": [
                    {
                        "description": "Item to start timer against",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StartTimerRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/time/stop": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Stops the currently running timer for the authenticated user.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "time"
                ],
                "summary": "Stop Timer",
                "parameters": [
                    {
                        "description": "Timer stop data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StopTimerRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/time/uninvoice": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Marks one or more time log entries as not invoiced.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "time"
                ],
                "summary": "Un-Invoice Time Logs",
                "parameters": [
                    {
                        "description": "Time log IDs",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateTimelogUnInvoiceRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/time/{timeid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Time Record by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "time"
                ],
                "summary": "Get Time Record",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Time Record ID",
                        "name": "timeid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TimeGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Update an existing Time Record.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "time"
                ],
                "summary": "Update Time Record",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Time Record ID",
                        "name": "timeid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.TimeUpdatePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Delete an existing Time Record.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "time"
                ],
                "summary": "Delete Time Record",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Time Record ID",
                        "name": "timeid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/timeallocations": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns a list of Time Allocations based on the specified filters. The fields parameter allows you to choose which data fields to return for each allocation.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "timeallocations"
                ],
                "summary": "Get Time Allocations",
                "parameters": [
                    {
                        "type": "string",
                        "default": "contact,item,project,time",
                        "description": "Comma-separated fields to return. Available: contact, item (or task), itemid (or taskid), project, time, labour, all",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Project ID or list of Project IDs (comma-separated)",
                        "name": "projectid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Contact ID or list of Contact IDs (comma-separated)",
                        "name": "contactid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Item (task) ID or list of IDs (comma-separated). Alias: taskid",
                        "name": "itemid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2",
                        "description": "Alias for itemid parameter.",
                        "name": "taskid",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "active",
                            "complete",
                            "all"
                        ],
                        "type": "string",
                        "default": "active",
                        "description": "Filter by project status",
                        "name": "projectstatus",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1",
                        "description": "Division ID (Advanced plan only)",
                        "name": "divisionid",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Allocations with ID \u003e= this value",
                        "name": "idfrom",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Allocations with ID \u003c= this value",
                        "name": "idto",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "1,2,3",
                        "description": "List of Time Allocation IDs (comma-separated)",
                        "name": "id",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "id",
                            "contactid",
                            "itemid",
                            "taskid",
                            "projectid"
                        ],
                        "type": "string",
                        "default": "id",
                        "description": "Sort field",
                        "name": "sortby",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "default": "asc",
                        "description": "Sort order",
                        "name": "sortorder",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 1,
                        "description": "Page number (must be used with pagesize)",
                        "name": "pagenumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 50,
                        "description": "Page size (must be used with pagenumber)",
                        "name": "pagesize",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "default": false,
                        "description": "Include total row count in meta (default false). Set to true to run the count query.",
                        "name": "includetotalrows",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TimeAllocationListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates multiple Time Allocations in a single call. Each item in the array must include an id.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "timeallocations"
                ],
                "summary": "Update Time Allocations (batch)",
                "parameters": [
                    {
                        "description": "Array of time allocations to update (each must include id)",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/handlers.TimeAllocationUpdatePayload"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Creates one or more Time Allocations. Accepts a JSON array of objects matching the SetTimeAllocationInput schema.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "timeallocations"
                ],
                "summary": "Create Time Allocations",
                "parameters": [
                    {
                        "description": "Array of time allocations to create",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/handlers.TimeAllocationCreatePayload"
                            }
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Deletes multiple Time Allocations by ID. The GraphQL setTimeAllocation mutation is called with deleted=true for each allocation.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "timeallocations"
                ],
                "summary": "Delete Time Allocations (batch)",
                "parameters": [
                    {
                        "description": "IDs to delete",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.TimeAllocationDeletePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/timeallocations/{timeallocationid}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns details of a single Time Allocation.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "timeallocations"
                ],
                "summary": "Get Time Allocation",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Time Allocation ID",
                        "name": "timeallocationid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TimeAllocationGetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Updates an existing Time Allocation.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "timeallocations"
                ],
                "summary": "Update Time Allocation",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Time Allocation ID",
                        "name": "timeallocationid",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.TimeAllocationUpdatePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Deletes a single Time Allocation by ID.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "timeallocations"
                ],
                "summary": "Delete Time Allocation",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Time Allocation ID",
                        "name": "timeallocationid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SuccessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "handlers.AddContactItemsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.AdjustProjectDatesPayload": {
            "type": "object",
            "properties": {
                "days": {
                    "type": "integer",
                    "example": 5
                },
                "direction": {
                    "type": "string",
                    "enum": [
                        "forward",
                        "backward"
                    ],
                    "example": "forward"
                },
                "shiftchilddates": {
                    "type": "integer",
                    "example": 5
                }
            }
        },
        "handlers.BulkAdjustPhaseDatesPayload": {
            "type": "object",
            "properties": {
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "shiftchilddates": {
                    "type": "integer",
                    "example": 7
                }
            }
        },
        "handlers.BulkAdjustProjectDatesPayload": {
            "type": "object",
            "properties": {
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "shiftchilddates": {
                    "type": "integer",
                    "example": 7
                },
                "shiftdates": {
                    "type": "integer",
                    "example": 7
                }
            }
        },
        "handlers.BulkDeleteInvoicesPayload": {
            "type": "object",
            "properties": {
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.BulkDeleteProjectsPayload": {
            "type": "object",
            "properties": {
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.BulkDeleteQuotesPayload": {
            "type": "object",
            "properties": {
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.BulkUpdateItemWorkStageRequest": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 9
                },
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.BulkUpdateItemsDiscountPayload": {
            "type": "object",
            "properties": {
                "amount": {
                    "type": "number",
                    "example": 100
                },
                "percent": {
                    "type": "number",
                    "example": 10
                }
            }
        },
        "handlers.BulkUpdateItemsPayload": {
            "type": "object",
            "properties": {
                "billType": {
                    "type": "integer",
                    "example": 1
                },
                "budgetType": {
                    "description": "Financial",
                    "type": "integer",
                    "example": 1
                },
                "categoryid": {
                    "type": "integer",
                    "example": 1
                },
                "code": {
                    "type": "string",
                    "example": "TASK-001"
                },
                "discount": {
                    "$ref": "#/definitions/handlers.BulkUpdateItemsDiscountPayload"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "effortScore": {
                    "type": "integer",
                    "example": 2
                },
                "hourlyrateserviceid": {
                    "type": "integer",
                    "example": 1
                },
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "impactScore": {
                    "type": "integer",
                    "example": 3
                },
                "importanceScore": {
                    "type": "integer",
                    "example": 4
                },
                "inAccountingCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "inLabourPrice": {
                    "type": "number",
                    "example": 40
                },
                "inTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "inUnitId": {
                    "type": "integer",
                    "example": 1
                },
                "inUnitPrice": {
                    "type": "number",
                    "example": 50
                },
                "inUnitQty": {
                    "type": "number",
                    "example": 10.5
                },
                "itemtypeid": {
                    "type": "integer",
                    "example": 1
                },
                "manualBillAmount": {
                    "type": "number",
                    "example": 5000
                },
                "manualBudget": {
                    "type": "number",
                    "example": 5000
                },
                "manualPercentageComplete": {
                    "description": "Scheduling",
                    "type": "number",
                    "example": 75.5
                },
                "outAccountingCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "outLabourPrice": {
                    "type": "number",
                    "example": 60
                },
                "outLabourPriceMultiplier": {
                    "type": "number",
                    "example": 1.5
                },
                "outTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "outUnitId": {
                    "type": "integer",
                    "example": 1
                },
                "outUnitPrice": {
                    "type": "number",
                    "example": 75
                },
                "outUnitPriceMultiplier": {
                    "type": "number",
                    "example": 1.5
                },
                "outUnitQty": {
                    "type": "number",
                    "example": 10.5
                },
                "priorityid": {
                    "description": "Priority",
                    "type": "integer",
                    "example": 3
                },
                "productid": {
                    "description": "Identification",
                    "type": "integer",
                    "example": 4
                },
                "projectedTimeManual": {
                    "type": "integer",
                    "example": 7200
                },
                "projectedTimeSpent": {
                    "type": "integer",
                    "example": 3600
                },
                "shiftDates": {
                    "type": "integer",
                    "example": 7
                },
                "startdate": {
                    "description": "Dates",
                    "type": "string",
                    "example": "2024-01-15"
                },
                "storyPoints": {
                    "description": "Scoring",
                    "type": "integer",
                    "example": 5
                },
                "urgencyScore": {
                    "type": "integer",
                    "example": 3
                }
            }
        },
        "handlers.BulkUpdatePhasesPayload": {
            "type": "object",
            "properties": {
                "billType": {
                    "type": "integer",
                    "example": 1
                },
                "budgetType": {
                    "description": "Financial",
                    "type": "integer",
                    "example": 1
                },
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "inAccountingCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "inTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "manualBillAmount": {
                    "type": "number",
                    "example": 5000
                },
                "manualBudget": {
                    "type": "number",
                    "example": 5000
                },
                "outAccountingCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "outTaxCodeId": {
                    "type": "integer",
                    "example": 1
                }
            }
        },
        "handlers.BulkUpdateProjectsPayload": {
            "type": "object",
            "properties": {
                "categoryid": {
                    "description": "Classification",
                    "type": "integer",
                    "example": 1
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "notification": {
                    "description": "Settings",
                    "type": "boolean",
                    "example": true
                },
                "priorityid": {
                    "description": "Priority",
                    "type": "integer",
                    "example": 3
                },
                "startdate": {
                    "description": "Dates",
                    "type": "string",
                    "example": "2024-01-15"
                }
            }
        },
        "handlers.BulkUpdateQuotesPayload": {
            "type": "object",
            "properties": {
                "clientaccess": {
                    "description": "Access",
                    "type": "boolean",
                    "example": true
                },
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "layoutid": {
                    "description": "Layout",
                    "type": "integer",
                    "example": 5
                },
                "validdate": {
                    "description": "Dates",
                    "type": "string",
                    "example": "2024-03-31"
                }
            }
        },
        "handlers.CloneDateSetting": {
            "type": "object",
            "properties": {
                "keep": {
                    "type": "boolean",
                    "example": true
                },
                "newStartDate": {
                    "type": "string",
                    "example": "2026-05-01"
                }
            }
        },
        "handlers.CloneItemsRequest": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "intoCollectionId": {
                    "type": "integer",
                    "example": 456
                }
            }
        },
        "handlers.CloneProjectClientInput": {
            "type": "object",
            "properties": {
                "companyid": {
                    "type": "integer",
                    "example": 42
                },
                "contactid": {
                    "type": "integer",
                    "example": 7
                }
            }
        },
        "handlers.CloneProjectData": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "example": 123
                },
                "number": {
                    "type": "string",
                    "example": "PRJ-042"
                },
                "title": {
                    "type": "string",
                    "example": "Cloned Project"
                }
            }
        },
        "handlers.CloneProjectNexusRequest": {
            "type": "object",
            "properties": {
                "dateSetting": {
                    "$ref": "#/definitions/handlers.CloneDateSetting"
                },
                "includeItems": {
                    "type": "boolean",
                    "example": true
                },
                "includeTags": {
                    "type": "boolean",
                    "example": true
                },
                "makeTemplate": {
                    "type": "boolean",
                    "example": false
                },
                "number": {
                    "type": "string",
                    "example": "PRJ-042"
                },
                "projectclient": {
                    "$ref": "#/definitions/handlers.CloneProjectClientInput"
                },
                "title": {
                    "type": "string",
                    "example": "Cloned Project"
                }
            }
        },
        "handlers.CloneProjectNexusResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.CloneProjectData"
                },
                "message": {
                    "type": "string",
                    "example": "Project cloned"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.CloneQuoteInvoiceRequest": {
            "type": "object",
            "properties": {
                "companyid": {
                    "type": "integer",
                    "example": 42
                },
                "makeTemplate": {
                    "type": "boolean",
                    "example": false
                },
                "title": {
                    "type": "string",
                    "example": "Cloned Invoice"
                }
            }
        },
        "handlers.CompanyContactCreatePayload": {
            "type": "object",
            "properties": {
                "companyid": {
                    "type": "integer"
                }
            }
        },
        "handlers.CompanyContactItem": {
            "type": "object",
            "properties": {
                "email": {
                    "type": "string",
                    "example": "jane@example.com"
                },
                "firstname": {
                    "type": "string",
                    "example": "Jane"
                },
                "id": {
                    "type": "integer",
                    "example": 42
                },
                "image": {
                    "type": "string",
                    "example": "https://example.com/avatar.jpg"
                },
                "lastname": {
                    "type": "string",
                    "example": "Smith"
                },
                "mobilephone": {
                    "type": "string",
                    "example": "+1 555 0101"
                },
                "name": {
                    "type": "string",
                    "example": "Jane Smith"
                },
                "type": {
                    "type": "string",
                    "example": "staff"
                },
                "workphone": {
                    "type": "string",
                    "example": "+1 555 0100"
                }
            }
        },
        "handlers.CompanyGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.CompanyResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.CompanyListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CompanyResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.CompanyLocationCreatePayload": {
            "type": "object",
            "properties": {
                "active": {
                    "type": "boolean",
                    "example": true
                },
                "addressLine1": {
                    "type": "string",
                    "example": "123 Main St"
                },
                "addressLine2": {
                    "type": "string",
                    "example": "Suite 100"
                },
                "addressLine3": {
                    "type": "string",
                    "example": ""
                },
                "city": {
                    "type": "string",
                    "example": "New York"
                },
                "code": {
                    "type": "string",
                    "example": "HQ"
                },
                "companyid": {
                    "type": "integer",
                    "example": 1
                },
                "countryid": {
                    "type": "integer",
                    "example": 1
                },
                "deliveryInstructions": {
                    "type": "string",
                    "example": "Leave at reception"
                },
                "description": {
                    "type": "string",
                    "example": "Primary office location"
                },
                "email": {
                    "type": "string",
                    "example": "office@example.com"
                },
                "formattedAddress": {
                    "type": "string",
                    "example": "123 Main St, New York, NY 10001"
                },
                "latitude": {
                    "type": "number",
                    "example": -36.8485
                },
                "longitude": {
                    "type": "number",
                    "example": 174.7633
                },
                "name": {
                    "type": "string",
                    "example": "Head Office"
                },
                "phone": {
                    "type": "string",
                    "example": "+1 555 0100"
                },
                "phone2": {
                    "type": "string",
                    "example": "+1 555 0101"
                },
                "placeid": {
                    "type": "string",
                    "example": "ChIJN1t_tDeuEmsRUsoyG83frY4"
                },
                "stateRegion": {
                    "type": "string",
                    "example": "NY"
                },
                "suburb": {
                    "type": "string",
                    "example": "Downtown"
                },
                "type": {
                    "type": "string",
                    "example": "postal"
                },
                "zipcode": {
                    "type": "string",
                    "example": "10001"
                }
            }
        },
        "handlers.CompanyLocationGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.CompanyLocationResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.CompanyLocationItem": {
            "type": "object",
            "properties": {
                "active": {
                    "type": "boolean"
                },
                "address1": {
                    "type": "string"
                },
                "address2": {
                    "type": "string"
                },
                "address3": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "companyid": {
                    "type": "integer"
                },
                "countryid": {
                    "type": "integer"
                },
                "deliveryinstructions": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "formattedaddress": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "lastmodifiedutc": {
                    "type": "string"
                },
                "latitude": {
                    "type": "number"
                },
                "longitude": {
                    "type": "number"
                },
                "name": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "phone2": {
                    "type": "string"
                },
                "placeid": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                },
                "suburb": {
                    "type": "string"
                },
                "zipcode": {
                    "type": "string"
                }
            }
        },
        "handlers.CompanyLocationListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CompanyLocationResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.CompanyLocationResponse": {
            "type": "object",
            "properties": {
                "active": {
                    "type": "boolean"
                },
                "address1": {
                    "type": "string"
                },
                "address2": {
                    "type": "string"
                },
                "address3": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "companyid": {
                    "type": "integer"
                },
                "countryid": {
                    "type": "integer"
                },
                "deliveryinstructions": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "formattedaddress": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "lastmodifiedutc": {
                    "type": "string"
                },
                "latitude": {
                    "type": "number"
                },
                "longitude": {
                    "type": "number"
                },
                "name": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "phone2": {
                    "type": "string"
                },
                "placeid": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                },
                "suburb": {
                    "type": "string"
                },
                "zipcode": {
                    "type": "string"
                }
            }
        },
        "handlers.CompanyLocationUpdatePayload": {
            "type": "object",
            "properties": {
                "active": {
                    "type": "boolean",
                    "example": true
                },
                "addressLine1": {
                    "type": "string",
                    "example": "123 Main St"
                },
                "addressLine2": {
                    "type": "string",
                    "example": "Suite 100"
                },
                "addressLine3": {
                    "type": "string",
                    "example": ""
                },
                "city": {
                    "type": "string",
                    "example": "New York"
                },
                "code": {
                    "type": "string",
                    "example": "HQ"
                },
                "countryid": {
                    "type": "integer",
                    "example": 1
                },
                "deliveryInstructions": {
                    "type": "string",
                    "example": "Leave at reception"
                },
                "description": {
                    "type": "string",
                    "example": "Primary office location"
                },
                "email": {
                    "type": "string",
                    "example": "office@example.com"
                },
                "formattedAddress": {
                    "type": "string",
                    "example": "123 Main St, New York, NY 10001"
                },
                "latitude": {
                    "type": "number",
                    "example": -36.8485
                },
                "longitude": {
                    "type": "number",
                    "example": 174.7633
                },
                "name": {
                    "type": "string",
                    "example": "Head Office"
                },
                "phone": {
                    "type": "string",
                    "example": "+1 555 0100"
                },
                "phone2": {
                    "type": "string",
                    "example": "+1 555 0101"
                },
                "placeid": {
                    "type": "string",
                    "example": "ChIJN1t_tDeuEmsRUsoyG83frY4"
                },
                "stateRegion": {
                    "type": "string",
                    "example": "NY"
                },
                "suburb": {
                    "type": "string",
                    "example": "Downtown"
                },
                "type": {
                    "type": "string",
                    "example": "postal"
                },
                "zipcode": {
                    "type": "string",
                    "example": "10001"
                }
            }
        },
        "handlers.CompanyNoteCreatePayload": {
            "type": "object",
            "properties": {
                "companyid": {
                    "type": "integer",
                    "example": 1
                },
                "note": {
                    "type": "string",
                    "example": "Follow up scheduled for next week."
                }
            }
        },
        "handlers.CompanyNoteGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.CompanyNoteResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.CompanyNoteListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CompanyNoteResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.CompanyNoteResponse": {
            "type": "object",
            "properties": {
                "companyid": {
                    "type": "integer"
                },
                "creatorid": {
                    "type": "integer"
                },
                "creatorname": {
                    "type": "string"
                },
                "datecreated": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "lastmodifiedutc": {
                    "type": "string"
                },
                "note": {
                    "type": "string"
                }
            }
        },
        "handlers.CompanyNoteUpdatePayload": {
            "type": "object",
            "properties": {
                "note": {
                    "type": "string",
                    "example": "Updated follow up note."
                }
            }
        },
        "handlers.CompanyProjectCreatePayload": {
            "type": "object",
            "properties": {
                "number": {
                    "type": "string",
                    "example": "PRJ-001"
                },
                "title": {
                    "type": "string",
                    "example": "Website Redesign"
                }
            }
        },
        "handlers.CompanyResponse": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "contacts": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CompanyContactItem"
                    }
                },
                "email": {
                    "type": "string"
                },
                "fax": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "image": {
                    "type": "string"
                },
                "lastmodifiedutc": {
                    "type": "string"
                },
                "locations": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CompanyLocationItem"
                    }
                },
                "maincompanylocationid": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CompanyTagItem"
                    }
                },
                "type": {
                    "type": "string"
                },
                "website": {
                    "type": "string"
                }
            }
        },
        "handlers.CompanySummaryContactItem": {
            "type": "object",
            "properties": {
                "companyid": {
                    "type": "integer",
                    "example": 42
                },
                "companyname": {
                    "type": "string",
                    "example": "Acme Corp"
                },
                "email": {
                    "type": "string",
                    "example": "john@example.com"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "mobilephone": {
                    "type": "string",
                    "example": "555-5678"
                },
                "name": {
                    "type": "string",
                    "example": "John Smith"
                },
                "type": {
                    "type": "string",
                    "example": "client"
                },
                "workphone": {
                    "type": "string",
                    "example": "555-1234"
                }
            }
        },
        "handlers.CompanySummaryData": {
            "type": "object",
            "properties": {
                "contacts": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CompanySummaryContactItem"
                    }
                },
                "invoices": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CompanySummaryInvoiceItem"
                    }
                },
                "phases": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CompanySummaryPhaseItem"
                    }
                },
                "projects": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CompanySummaryProjectItem"
                    }
                },
                "quotes": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CompanySummaryQuoteItem"
                    }
                },
                "totals": {
                    "$ref": "#/definitions/handlers.CompanySummaryTotals"
                }
            }
        },
        "handlers.CompanySummaryInvoiceItem": {
            "type": "object",
            "properties": {
                "companyid": {
                    "type": "integer",
                    "example": 42
                },
                "companyname": {
                    "type": "string",
                    "example": "Acme Corp"
                },
                "grandtotal": {
                    "type": "number",
                    "example": 1100
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "number": {
                    "type": "string",
                    "example": "INV-001"
                },
                "subtotal": {
                    "type": "number",
                    "example": 1000
                },
                "taxtotal": {
                    "type": "number",
                    "example": 100
                },
                "title": {
                    "type": "string",
                    "example": "Website Redesign"
                }
            }
        },
        "handlers.CompanySummaryPhaseItem": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Design Phase"
                },
                "projectid": {
                    "type": "integer",
                    "example": 10
                },
                "projectnumber": {
                    "type": "string",
                    "example": "PRJ-001"
                },
                "projecttitle": {
                    "type": "string",
                    "example": "Website Redesign"
                }
            }
        },
        "handlers.CompanySummaryProjectItem": {
            "type": "object",
            "properties": {
                "companyid": {
                    "type": "integer",
                    "example": 42
                },
                "companyname": {
                    "type": "string",
                    "example": "Acme Corp"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "number": {
                    "type": "string",
                    "example": "PRJ-001"
                },
                "title": {
                    "type": "string",
                    "example": "Website Redesign"
                }
            }
        },
        "handlers.CompanySummaryQuoteItem": {
            "type": "object",
            "properties": {
                "companyid": {
                    "type": "integer",
                    "example": 42
                },
                "companyname": {
                    "type": "string",
                    "example": "Acme Corp"
                },
                "grandtotal": {
                    "type": "number",
                    "example": 1100
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "number": {
                    "type": "string",
                    "example": "Q-001"
                },
                "subtotal": {
                    "type": "number",
                    "example": 1000
                },
                "taxtotal": {
                    "type": "number",
                    "example": 100
                },
                "title": {
                    "type": "string",
                    "example": "Website Redesign"
                }
            }
        },
        "handlers.CompanySummaryResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.CompanySummaryData"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.CompanySummaryTotals": {
            "type": "object",
            "properties": {
                "contacts": {
                    "type": "integer",
                    "example": 42
                },
                "invoices": {
                    "type": "integer",
                    "example": 10
                },
                "phases": {
                    "type": "integer",
                    "example": 8
                },
                "projects": {
                    "type": "integer",
                    "example": 5
                },
                "quotes": {
                    "type": "integer",
                    "example": 3
                }
            }
        },
        "handlers.CompanyTagItem": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "#FF0000"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "VIP"
                }
            }
        },
        "handlers.CompanyTagListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CompanyTagResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.CompanyTagResponse": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "type": "string",
                    "example": "VIP"
                },
                "sortorder": {
                    "type": "integer",
                    "example": 1
                }
            }
        },
        "handlers.CompanyTagUpdatePayload": {
            "type": "object",
            "properties": {
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                }
            }
        },
        "handlers.CompleteItemsRequest": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.ContactDetailResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ContactResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ContactGroupGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ContactGroupResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ContactGroupListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactGroupResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ContactGroupResponse": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "teamid": {
                    "type": "integer"
                }
            }
        },
        "handlers.ContactGroupsResponse": {
            "type": "object",
            "properties": {
                "groups": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.GroupTeamItem"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                },
                "teams": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.GroupTeamItem"
                    }
                }
            }
        },
        "handlers.ContactListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ContactNoteGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ContactNoteResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ContactNoteListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactNoteResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ContactNoteResponse": {
            "type": "object",
            "properties": {
                "authorid": {
                    "type": "integer"
                },
                "authorname": {
                    "type": "string"
                },
                "content": {
                    "type": "string"
                },
                "date": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                }
            }
        },
        "handlers.ContactPermissionResponse": {
            "type": "object",
            "properties": {
                "add": {
                    "type": "boolean",
                    "example": true
                },
                "contactid": {
                    "type": "integer",
                    "example": 5
                },
                "delete": {
                    "type": "boolean",
                    "example": false
                },
                "edit": {
                    "type": "boolean",
                    "example": true
                },
                "name": {
                    "type": "string",
                    "example": "Manage Companies"
                },
                "permissionid": {
                    "type": "integer",
                    "example": 8
                },
                "view": {
                    "type": "boolean",
                    "example": true
                }
            }
        },
        "handlers.ContactProjectsPayload": {
            "type": "object",
            "properties": {
                "projectid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.ContactResponse": {
            "type": "object",
            "properties": {
                "address1": {
                    "type": "string",
                    "example": "123 Main St"
                },
                "address2": {
                    "type": "string",
                    "example": "Suite 100"
                },
                "address3": {
                    "type": "string",
                    "example": ""
                },
                "allowlogin": {
                    "type": "boolean",
                    "example": true
                },
                "city": {
                    "type": "string",
                    "example": "New York"
                },
                "companyid": {
                    "type": "integer",
                    "example": 1
                },
                "companyname": {
                    "type": "string",
                    "example": "Acme Corp"
                },
                "country": {
                    "type": "string",
                    "example": "USA"
                },
                "defaulthourlyrateid": {
                    "type": "integer",
                    "example": 1
                },
                "divisionid": {
                    "type": "integer",
                    "example": 1
                },
                "email": {
                    "type": "string",
                    "example": "john@example.com"
                },
                "fax": {
                    "type": "string",
                    "example": "123-456-7892"
                },
                "firstname": {
                    "type": "string",
                    "example": "John"
                },
                "groups": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactSubGroup"
                    }
                },
                "ianatimezone": {
                    "type": "string",
                    "example": "Pacific/Auckland"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "image": {
                    "type": "string",
                    "example": "https://cdn.proworkflow.com/images/contact/1.jpg"
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-15T15:30:00"
                },
                "lastname": {
                    "type": "string",
                    "example": "Smith"
                },
                "mobilephone": {
                    "type": "string",
                    "example": "123-456-7891"
                },
                "notes": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactSubNote"
                    }
                },
                "payrate": {
                    "type": "number",
                    "example": 50
                },
                "payratemultiplier": {
                    "type": "number",
                    "example": 1.5
                },
                "pending": {
                    "type": "boolean",
                    "example": false
                },
                "roles": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactSubRole"
                    }
                },
                "state": {
                    "type": "string",
                    "example": "NY"
                },
                "status": {
                    "type": "string",
                    "example": "active"
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactSubTag"
                    }
                },
                "teams": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactSubTeam"
                    }
                },
                "title": {
                    "type": "string",
                    "example": "CEO"
                },
                "type": {
                    "type": "string",
                    "example": "staff"
                },
                "username": {
                    "type": "string",
                    "example": "jsmith"
                },
                "workphone": {
                    "type": "string",
                    "example": "123-456-7890"
                },
                "zipcode": {
                    "type": "string",
                    "example": "10001"
                }
            }
        },
        "handlers.ContactRoleListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactRoleResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ContactRoleResponse": {
            "type": "object",
            "properties": {
                "displayorder": {
                    "type": "integer",
                    "example": 1
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Developer"
                }
            }
        },
        "handlers.ContactRolesPayload": {
            "type": "object",
            "properties": {
                "roleid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.ContactSubGroup": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Designers"
                }
            }
        },
        "handlers.ContactSubNote": {
            "type": "object",
            "properties": {
                "authorid": {
                    "type": "integer",
                    "example": 10
                },
                "authorname": {
                    "type": "string",
                    "example": "John Smith"
                },
                "content": {
                    "type": "string",
                    "example": "This is a note about the contact"
                },
                "date": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                }
            }
        },
        "handlers.ContactSubRole": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Manager"
                }
            }
        },
        "handlers.ContactSubTag": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "VIP"
                }
            }
        },
        "handlers.ContactSubTeam": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Marketing"
                }
            }
        },
        "handlers.ContactTagGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ContactTagResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ContactTagListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactTagResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ContactTagResponse": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "type": "string",
                    "example": "VIP"
                }
            }
        },
        "handlers.ContactsToItemsPayload": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.CreateCompanyPayload": {
            "type": "object",
            "properties": {
                "avatarname": {
                    "type": "string",
                    "example": "avatar.jpg"
                },
                "categoryid": {
                    "description": "Additional fields",
                    "type": "integer",
                    "example": 1
                },
                "code": {
                    "type": "string",
                    "example": "ABC"
                },
                "companies": {
                    "description": "Batch creation (array of companies)",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CreateCompanyPayload"
                    }
                },
                "creatorid": {
                    "type": "integer",
                    "example": 1
                },
                "email": {
                    "type": "string",
                    "example": "info@abc.com"
                },
                "facebook": {
                    "description": "Social media",
                    "type": "string",
                    "example": "https://facebook.com/abc"
                },
                "fax": {
                    "type": "string",
                    "example": "123-456-7891"
                },
                "isperson": {
                    "type": "boolean"
                },
                "linkedin": {
                    "type": "string",
                    "example": "https://linkedin.com/company/abc"
                },
                "maincompanylocationid": {
                    "type": "integer",
                    "example": 1
                },
                "maincontactid": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "description": "Basic fields",
                    "type": "string",
                    "example": "ABC Corporation"
                },
                "phone": {
                    "description": "Contact information",
                    "type": "string",
                    "example": "123-456-7890"
                },
                "tagid": {
                    "description": "Tags",
                    "type": "string",
                    "example": "1,2,3"
                },
                "twitter": {
                    "type": "string",
                    "example": "@abccorp"
                },
                "type": {
                    "type": "string",
                    "enum": [
                        "client",
                        "contractor",
                        "staff",
                        "other"
                    ],
                    "example": "client"
                },
                "website": {
                    "type": "string",
                    "example": "https://www.abc.com"
                }
            }
        },
        "handlers.CreateContactNotePayload": {
            "type": "object",
            "properties": {
                "note": {
                    "type": "string",
                    "example": "This is a note about the contact"
                }
            }
        },
        "handlers.CreateContactPayload": {
            "type": "object",
            "properties": {
                "address1": {
                    "description": "Address",
                    "type": "string",
                    "example": "123 Main St"
                },
                "address2": {
                    "type": "string",
                    "example": "Suite 100"
                },
                "address3": {
                    "type": "string",
                    "example": ""
                },
                "allowlogin": {
                    "description": "Login/Access",
                    "type": "boolean",
                    "example": true
                },
                "city": {
                    "type": "string",
                    "example": "New York"
                },
                "companyid": {
                    "description": "Company/Organization",
                    "type": "integer",
                    "example": 1
                },
                "country": {
                    "type": "string",
                    "example": "USA"
                },
                "defaulthourlyrateid": {
                    "description": "Additional",
                    "type": "integer",
                    "example": 1
                },
                "divisionid": {
                    "type": "integer",
                    "example": 1
                },
                "email": {
                    "type": "string",
                    "example": "john@example.com"
                },
                "emailsignature": {
                    "description": "Settings",
                    "type": "string",
                    "example": "\u003cp\u003eBest regards,\u003cbr\u003eJohn\u003c/p\u003e"
                },
                "firstname": {
                    "description": "Basic information",
                    "type": "string",
                    "example": "John"
                },
                "groupid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "ianatimezone": {
                    "type": "string",
                    "example": "Pacific/Auckland"
                },
                "lastname": {
                    "type": "string",
                    "example": "Smith"
                },
                "mobilephone": {
                    "type": "string",
                    "example": "123-456-7891"
                },
                "primarycontact": {
                    "type": "boolean"
                },
                "roleid": {
                    "type": "string",
                    "example": "1,2"
                },
                "showhistoric": {
                    "type": "boolean"
                },
                "state": {
                    "type": "string",
                    "example": "NY"
                },
                "tagid": {
                    "description": "Tags",
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "title": {
                    "type": "string",
                    "example": "CEO"
                },
                "type": {
                    "type": "string",
                    "enum": [
                        "client",
                        "contractor",
                        "staff",
                        "other",
                        "supplier"
                    ],
                    "example": "client"
                },
                "workphone": {
                    "description": "Contact information",
                    "type": "string",
                    "example": "123-456-7890"
                },
                "zipcode": {
                    "type": "string",
                    "example": "10001"
                }
            }
        },
        "handlers.CreateContactTagPayload": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "name": {
                    "type": "string",
                    "example": "VIP"
                }
            }
        },
        "handlers.CreateCustomFieldOptionPayload": {
            "type": "object",
            "properties": {
                "customfieldid": {
                    "type": "integer"
                },
                "deleted": {
                    "type": "boolean"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "handlers.CreateCustomFieldPayload": {
            "type": "object",
            "properties": {
                "active": {
                    "type": "boolean"
                },
                "name": {
                    "type": "string"
                },
                "staffonly": {
                    "type": "boolean"
                },
                "type": {
                    "type": "string",
                    "enum": [
                        "checkbox",
                        "date",
                        "dropdown",
                        "number",
                        "percentage",
                        "rating",
                        "staff",
                        "text"
                    ]
                }
            }
        },
        "handlers.CreateExternalProjectPayload": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 1
                },
                "categoryid": {
                    "description": "Categorization",
                    "type": "integer",
                    "example": 1
                },
                "chargeRateType": {
                    "type": "integer",
                    "example": 1
                },
                "clientaccess": {
                    "description": "Access settings",
                    "type": "boolean"
                },
                "clientid": {
                    "description": "Additional contact assignments",
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "clientviewalltasks": {
                    "type": "boolean"
                },
                "companyid": {
                    "description": "External client (required)",
                    "type": "integer",
                    "example": 5
                },
                "completedate": {
                    "type": "string",
                    "example": "2024-04-01"
                },
                "contractorid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        4,
                        5
                    ]
                },
                "costRateType": {
                    "description": "Financial fields",
                    "type": "integer",
                    "example": 1
                },
                "customfields": {
                    "description": "Custom field values to set on creation",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectCustomFieldInput"
                    }
                },
                "customformtitle": {
                    "type": "string",
                    "example": "Custom Form"
                },
                "description": {
                    "type": "string",
                    "example": "Complete website redesign project"
                },
                "divisionid": {
                    "description": "Division/Organization",
                    "type": "integer",
                    "example": 1
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-03-15"
                },
                "icalcontactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "managementteam": {
                    "description": "Management team (required)",
                    "allOf": [
                        {
                            "$ref": "#/definitions/handlers.ProjectManagementTeam"
                        }
                    ]
                },
                "notification": {
                    "type": "boolean"
                },
                "number": {
                    "type": "string",
                    "example": "PRJ-001"
                },
                "priorityid": {
                    "type": "integer",
                    "example": 2
                },
                "privatenotes": {
                    "description": "Additional fields",
                    "type": "string",
                    "example": "Internal notes"
                },
                "purchaseorder": {
                    "type": "string",
                    "example": "PO-12345"
                },
                "staffid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "staffviewalltasks": {
                    "type": "boolean"
                },
                "startdate": {
                    "description": "Date fields",
                    "type": "string",
                    "example": "2024-01-15"
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "template": {
                    "type": "boolean"
                },
                "templateused": {
                    "type": "integer",
                    "example": 1
                },
                "timeallocated": {
                    "type": "integer",
                    "example": 3600
                },
                "title": {
                    "description": "Basic fields",
                    "type": "string",
                    "example": "Website Redesign"
                },
                "worktypeid": {
                    "type": "integer",
                    "example": 1
                }
            }
        },
        "handlers.CreateFolderPayload": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "description": {
                    "type": "string",
                    "example": "Assets for client review"
                },
                "name": {
                    "type": "string",
                    "example": "Client Assets"
                },
                "ownerid": {
                    "type": "integer",
                    "example": 2
                },
                "projectid": {
                    "type": "integer",
                    "example": 10
                },
                "public": {
                    "type": "boolean",
                    "example": false
                },
                "size": {
                    "type": "integer",
                    "example": 204800
                },
                "taskid": {
                    "type": "integer",
                    "example": 5
                },
                "type": {
                    "type": "string",
                    "example": "custom"
                }
            }
        },
        "handlers.CreateGroupPayload": {
            "type": "object",
            "properties": {
                "contactids": {
                    "type": "string",
                    "example": "1,2,3"
                },
                "name": {
                    "type": "string",
                    "example": "Design Team"
                },
                "sortorder": {
                    "type": "string",
                    "example": "1"
                },
                "teamid": {
                    "type": "integer",
                    "example": 1
                }
            }
        },
        "handlers.CreateInternalProjectPayload": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 1
                },
                "categoryid": {
                    "description": "Categorization",
                    "type": "integer",
                    "example": 1
                },
                "chargeRateType": {
                    "type": "integer",
                    "example": 1
                },
                "clientaccess": {
                    "description": "Access settings",
                    "type": "boolean"
                },
                "clientviewalltasks": {
                    "type": "boolean"
                },
                "completedate": {
                    "type": "string",
                    "example": "2024-04-01"
                },
                "contactid": {
                    "description": "Internal client (required)",
                    "type": "integer",
                    "example": 101
                },
                "contractorid": {
                    "description": "Additional contact assignments",
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        4,
                        5
                    ]
                },
                "costRateType": {
                    "description": "Financial fields",
                    "type": "integer",
                    "example": 1
                },
                "customfields": {
                    "description": "Custom field values to set on creation",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectCustomFieldInput"
                    }
                },
                "customformtitle": {
                    "type": "string",
                    "example": "Custom Form"
                },
                "description": {
                    "type": "string",
                    "example": "Internal finance process improvement"
                },
                "divisionid": {
                    "description": "Division/Organization",
                    "type": "integer",
                    "example": 1
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-03-15"
                },
                "groupid": {
                    "type": "integer",
                    "example": 1
                },
                "icalcontactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "managementteam": {
                    "description": "Management team (required)",
                    "allOf": [
                        {
                            "$ref": "#/definitions/handlers.ProjectManagementTeam"
                        }
                    ]
                },
                "notification": {
                    "type": "boolean"
                },
                "number": {
                    "type": "string",
                    "example": "PRJ-002"
                },
                "priorityid": {
                    "type": "integer",
                    "example": 2
                },
                "privatenotes": {
                    "description": "Additional fields",
                    "type": "string",
                    "example": "Internal notes"
                },
                "purchaseorder": {
                    "type": "string",
                    "example": "PO-12345"
                },
                "staffid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "staffviewalltasks": {
                    "type": "boolean"
                },
                "startdate": {
                    "description": "Date fields",
                    "type": "string",
                    "example": "2024-01-15"
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "teamid": {
                    "type": "integer",
                    "example": 1
                },
                "template": {
                    "type": "boolean"
                },
                "templateused": {
                    "type": "integer",
                    "example": 1
                },
                "timeallocated": {
                    "type": "integer",
                    "example": 3600
                },
                "title": {
                    "description": "Basic fields",
                    "type": "string",
                    "example": "Finance Process Review"
                },
                "worktypeid": {
                    "type": "integer",
                    "example": 1
                }
            }
        },
        "handlers.CreateInvoiceFromProjectPayload": {
            "type": "object",
            "properties": {
                "companyid": {
                    "type": "integer",
                    "example": 123
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "groupby": {
                    "type": "string",
                    "enum": [
                        "project",
                        "phase",
                        "item",
                        "staff"
                    ],
                    "example": "project"
                },
                "invoicedate": {
                    "type": "string",
                    "example": "2024-01-15"
                },
                "invoiceid": {
                    "type": "integer",
                    "example": 456
                },
                "invoicetermid": {
                    "type": "integer",
                    "example": 1
                },
                "itemcollectionName": {
                    "type": "string",
                    "example": "Time Entries"
                },
                "itemid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "number": {
                    "type": "string",
                    "example": "INV-001"
                },
                "timelogid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        10,
                        11,
                        12
                    ]
                },
                "title": {
                    "type": "string",
                    "example": "Website Redesign Invoice"
                }
            }
        },
        "handlers.CreateInvoicePayload": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 1
                },
                "companyid": {
                    "description": "Company/Project",
                    "type": "integer",
                    "example": 5
                },
                "description": {
                    "type": "string",
                    "example": "Invoice for services rendered"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "invoicedate": {
                    "description": "Dates",
                    "type": "string",
                    "example": "2024-01-15"
                },
                "invoicetermid": {
                    "description": "Additional fields",
                    "type": "integer",
                    "example": 1
                },
                "number": {
                    "type": "string",
                    "example": "INV-001"
                },
                "projectid": {
                    "type": "integer",
                    "example": 10
                },
                "purchaseordernumber": {
                    "type": "string",
                    "example": "PO-12345"
                },
                "template": {
                    "type": "boolean"
                },
                "title": {
                    "description": "Basic fields",
                    "type": "string",
                    "example": "New Invoice"
                }
            }
        },
        "handlers.CreateInvoicePhasePayload": {
            "type": "object",
            "properties": {
                "billtype": {
                    "type": "integer",
                    "example": 1
                },
                "budgettype": {
                    "type": "integer",
                    "example": 1
                },
                "invoiceid": {
                    "type": "integer",
                    "example": 123
                },
                "name": {
                    "type": "string",
                    "example": "Phase 1"
                }
            }
        },
        "handlers.CreateItemCategoryPayload": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "name": {
                    "type": "string",
                    "example": "Design"
                },
                "sortorder": {
                    "type": "string",
                    "example": "1"
                }
            }
        },
        "handlers.CreateItemPayload": {
            "type": "object",
            "properties": {
                "billType": {
                    "type": "integer",
                    "example": 1
                },
                "budgetType": {
                    "type": "integer",
                    "example": 1
                },
                "categoryid": {
                    "type": "integer",
                    "example": 1
                },
                "chargeRateType": {
                    "type": "integer",
                    "example": 1
                },
                "code": {
                    "type": "string",
                    "example": "TASK-001"
                },
                "completedate": {
                    "type": "string",
                    "example": "2024-02-20"
                },
                "contactid": {
                    "type": "string",
                    "example": "1,2,3"
                },
                "costRateType": {
                    "type": "integer",
                    "example": 1
                },
                "description": {
                    "type": "string",
                    "example": "Design the homepage layout"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "effortScore": {
                    "type": "string",
                    "example": "medium"
                },
                "effortScoreId": {
                    "type": "integer",
                    "example": 2
                },
                "hourlyrateserviceid": {
                    "type": "integer",
                    "example": 1
                },
                "impactScore": {
                    "type": "string",
                    "example": "high"
                },
                "impactScoreId": {
                    "type": "integer",
                    "example": 1
                },
                "importanceScore": {
                    "type": "string",
                    "example": "high"
                },
                "importanceScoreId": {
                    "type": "integer",
                    "example": 1
                },
                "inAccountingCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "inLabourPrice": {
                    "type": "number",
                    "example": 40
                },
                "inTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "inUnitId": {
                    "type": "integer",
                    "example": 1
                },
                "inUnitPrice": {
                    "type": "number",
                    "example": 50
                },
                "inUnitQty": {
                    "type": "number",
                    "example": 10.5
                },
                "itemcollectionid": {
                    "type": "integer",
                    "example": 5
                },
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CreateItemPayload"
                    }
                },
                "itemtypeid": {
                    "type": "integer",
                    "example": 1
                },
                "manualPercentageComplete": {
                    "type": "number",
                    "example": 75.5
                },
                "name": {
                    "type": "string",
                    "example": "Design Homepage"
                },
                "outAccountingCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "outLabourPrice": {
                    "type": "number",
                    "example": 60
                },
                "outLabourPriceMultiplier": {
                    "type": "number",
                    "example": 1.5
                },
                "outTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "outUnitId": {
                    "type": "integer",
                    "example": 1
                },
                "outUnitPrice": {
                    "type": "number",
                    "example": 75
                },
                "outUnitPriceMultiplier": {
                    "type": "number",
                    "example": 1.5
                },
                "outUnitQty": {
                    "type": "number",
                    "example": 10.5
                },
                "parentid": {
                    "type": "integer",
                    "example": 2
                },
                "prerequisiteid": {
                    "type": "string",
                    "example": "1,2,3"
                },
                "priority": {
                    "type": "integer",
                    "example": 3
                },
                "priorityid": {
                    "type": "integer",
                    "example": 3
                },
                "productid": {
                    "type": "integer",
                    "example": 4
                },
                "projectedTimeManual": {
                    "type": "integer",
                    "example": 7200
                },
                "projectedTimeSpent": {
                    "type": "integer",
                    "example": 3600
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "complete"
                    ],
                    "example": "active"
                },
                "storyPoints": {
                    "type": "integer",
                    "example": 5
                },
                "tagid": {
                    "type": "string",
                    "example": "1,2"
                },
                "trackingOptionId": {
                    "type": "string",
                    "example": "1,2"
                },
                "urgencyScore": {
                    "type": "string",
                    "example": "medium"
                },
                "urgencyScoreId": {
                    "type": "integer",
                    "example": 2
                }
            }
        },
        "handlers.CreateItemTagPayload": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "name": {
                    "type": "string",
                    "example": "Urgent"
                }
            }
        },
        "handlers.CreateMessagePayload": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "content": {
                    "type": "string",
                    "example": "Here is the latest update..."
                },
                "fileid": {
                    "type": "string",
                    "example": "10,11"
                },
                "itemid": {
                    "type": "integer",
                    "example": 5
                },
                "projectid": {
                    "type": "integer",
                    "example": 10
                },
                "public": {
                    "type": "boolean",
                    "example": false
                },
                "subject": {
                    "type": "string",
                    "example": "Project update"
                }
            }
        },
        "handlers.CreateProjectBookmarkPayload": {
            "type": "object",
            "properties": {
                "title": {
                    "type": "string",
                    "example": "Example Site"
                },
                "url": {
                    "type": "string",
                    "example": "https://example.com"
                }
            }
        },
        "handlers.CreateProjectCategoryPayload": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "name": {
                    "type": "string",
                    "example": "Marketing"
                },
                "sortorder": {
                    "type": "string",
                    "example": "1"
                }
            }
        },
        "handlers.CreateProjectItemPayload": {
            "type": "object",
            "properties": {
                "categoryid": {
                    "type": "integer",
                    "example": 1
                },
                "code": {
                    "type": "string",
                    "example": "TASK-001"
                },
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "description": {
                    "type": "string",
                    "example": "Create homepage design mockups"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-01-20"
                },
                "itemcollectionid": {
                    "type": "integer",
                    "example": 5
                },
                "itemtypeid": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Design homepage"
                },
                "priority": {
                    "type": "integer",
                    "example": 2
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15"
                },
                "tagids": {
                    "type": "string",
                    "example": "1,2"
                }
            }
        },
        "handlers.CreateProjectMessagePayload": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "content": {
                    "type": "string",
                    "example": "The project is progressing well"
                },
                "itemid": {
                    "type": "integer",
                    "example": 1
                },
                "public": {
                    "type": "boolean",
                    "example": true
                },
                "subject": {
                    "type": "string",
                    "example": "Project Update"
                }
            }
        },
        "handlers.CreateProjectPhasePayload": {
            "type": "object",
            "properties": {
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "name": {
                    "type": "string",
                    "example": "Design Phase"
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15"
                }
            }
        },
        "handlers.CreateProjectTagPayload": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "name": {
                    "type": "string",
                    "example": "Urgent"
                }
            }
        },
        "handlers.CreateQuoteFromProjectPayload": {
            "type": "object",
            "properties": {
                "companyid": {
                    "type": "integer",
                    "example": 123
                },
                "itemid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "number": {
                    "type": "string",
                    "example": "Q-001"
                },
                "quotedate": {
                    "type": "string",
                    "example": "2024-01-15"
                },
                "quoteid": {
                    "type": "integer",
                    "example": 456
                },
                "title": {
                    "type": "string",
                    "example": "Website Redesign Quote"
                }
            }
        },
        "handlers.CreateQuoteItemPayload": {
            "type": "object",
            "properties": {
                "billamount": {
                    "type": "number",
                    "example": 6000
                },
                "billtype": {
                    "type": "integer",
                    "example": 1
                },
                "budget": {
                    "type": "number",
                    "example": 5000
                },
                "budgettype": {
                    "type": "integer",
                    "example": 1
                },
                "categoryid": {
                    "type": "integer",
                    "example": 2
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-01-31"
                },
                "itemcollectionid": {
                    "type": "integer",
                    "example": 456
                },
                "itemtypeid": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Design Work"
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "quoteid": {
                    "type": "integer",
                    "example": 123
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-01"
                },
                "timeallocated": {
                    "type": "number",
                    "example": 40
                }
            }
        },
        "handlers.CreateQuotePayload": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 1
                },
                "clientaccess": {
                    "type": "boolean"
                },
                "companyid": {
                    "description": "Company/Project",
                    "type": "integer",
                    "example": 5
                },
                "description": {
                    "type": "string",
                    "example": "Quote for services"
                },
                "number": {
                    "type": "string",
                    "example": "QUO-001"
                },
                "projectid": {
                    "type": "integer",
                    "example": 10
                },
                "quotedate": {
                    "description": "Dates",
                    "type": "string",
                    "example": "2024-01-15"
                },
                "quoteperiod": {
                    "type": "integer",
                    "example": 30
                },
                "template": {
                    "type": "boolean"
                },
                "title": {
                    "description": "Basic fields",
                    "type": "string",
                    "example": "New Quote"
                },
                "type": {
                    "description": "Additional fields",
                    "type": "string",
                    "enum": [
                        "estimate",
                        "quote"
                    ],
                    "example": "quote"
                },
                "validdate": {
                    "type": "string",
                    "example": "2024-02-15"
                }
            }
        },
        "handlers.CreateQuotePhasePayload": {
            "type": "object",
            "properties": {
                "billamount": {
                    "type": "number",
                    "example": 6000
                },
                "billtype": {
                    "type": "integer",
                    "example": 1
                },
                "budget": {
                    "type": "number",
                    "example": 5000
                },
                "budgettype": {
                    "type": "integer",
                    "example": 1
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-01-31"
                },
                "name": {
                    "type": "string",
                    "example": "Phase 1"
                },
                "quoteid": {
                    "type": "integer",
                    "example": 123
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-01"
                }
            }
        },
        "handlers.CreateResthookPayload": {
            "type": "object",
            "properties": {
                "event": {
                    "description": "Event type. One of: newcontact, newpendingcontact, editcontact, editcontactlocation, deletecontact, newcompany, newpendingcompany, editcompany, deletecompany, newfile, deletefile, newinvoice, editinvoice, deleteinvoice, newmessage, editmessage, deletemessage, newproject, editproject, editstageproject, deleteproject, completeproject, restoreProject, newprojectrequest, editprojectrequest, deleteprojectrequest, approveprojectrequest, declineprojectrequest, newquote, editquote, deletequote, newsharednote, editsharednote, deletesharednote, newtask, edittask, deletetask, completetask, reactivatetask, newtime, edittime, deletetime, starttimer, stoptimer, unknown",
                    "type": "string",
                    "enum": [
                        "newcontact",
                        "newpendingcontact",
                        "editcontact",
                        "editcontactlocation",
                        "deletecontact",
                        "newcompany",
                        "newpendingcompany",
                        "editcompany",
                        "deletecompany",
                        "newfile",
                        "deletefile",
                        "newinvoice",
                        "editinvoice",
                        "deleteinvoice",
                        "newmessage",
                        "editmessage",
                        "deletemessage",
                        "newproject",
                        "editproject",
                        "editstageproject",
                        "deleteproject",
                        "completeproject",
                        "restoreProject",
                        "newprojectrequest",
                        "editprojectrequest",
                        "deleteprojectrequest",
                        "approveprojectrequest",
                        "declineprojectrequest",
                        "newquote",
                        "editquote",
                        "deletequote",
                        "newsharednote",
                        "editsharednote",
                        "deletesharednote",
                        "newtask",
                        "edittask",
                        "deletetask",
                        "completetask",
                        "reactivatetask",
                        "newtime",
                        "edittime",
                        "deletetime",
                        "starttimer",
                        "stoptimer",
                        "unknown"
                    ],
                    "example": "newproject"
                },
                "url": {
                    "type": "string",
                    "example": "https://example.com/webhook"
                }
            }
        },
        "handlers.CreateRolePayload": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "name": {
                    "type": "string",
                    "example": "Project Manager"
                },
                "permissions": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SetRolePermissionInput"
                    }
                },
                "type": {
                    "type": "string",
                    "enum": [
                        "client",
                        "contractor",
                        "staff",
                        "other"
                    ],
                    "example": "staff"
                }
            }
        },
        "handlers.CreateTeamPayload": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string",
                    "example": "ENG"
                },
                "groupids": {
                    "type": "string",
                    "example": "1,2,3"
                },
                "name": {
                    "type": "string",
                    "example": "Engineering"
                },
                "sortorder": {
                    "type": "string",
                    "example": "1"
                }
            }
        },
        "handlers.CreateTemplatePhaseForTemplatePayload": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "example": "Design Phase"
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                }
            }
        },
        "handlers.CustomFieldListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CustomFieldResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.CustomFieldOptionItem": {
            "type": "object",
            "properties": {
                "displayorder": {
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "value": {
                    "type": "string"
                }
            }
        },
        "handlers.CustomFieldResponse": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "isActive": {
                    "type": "boolean",
                    "example": true
                },
                "name": {
                    "type": "string",
                    "example": "Priority Level"
                },
                "sortorder": {
                    "type": "string",
                    "example": "1"
                },
                "staffonly": {
                    "type": "boolean",
                    "example": false
                },
                "type": {
                    "type": "string",
                    "example": "dropdown"
                },
                "values": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CustomFieldOptionItem"
                    }
                }
            }
        },
        "handlers.DivisionGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.DivisionResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.DivisionListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.DivisionResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.DivisionResponse": {
            "type": "object",
            "properties": {
                "chargeRateType": {
                    "type": "string",
                    "example": "hourly"
                },
                "costRateType": {
                    "type": "string",
                    "example": "hourly"
                },
                "currencyid": {
                    "type": "integer",
                    "example": 1
                },
                "defaultpayrate": {
                    "type": "number",
                    "example": 50
                },
                "ianatimezone": {
                    "type": "string",
                    "example": "0"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Engineering Division"
                },
                "payratemultiplier": {
                    "type": "number",
                    "example": 1.5
                }
            }
        },
        "handlers.FileGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.FileResponse"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.FileListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.FileResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.FileResponse": {
            "type": "object",
            "properties": {
                "contactids": {
                    "type": "string"
                },
                "date": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "folderid": {
                    "type": "integer"
                },
                "foldername": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "itemid": {
                    "type": "integer"
                },
                "itemname": {
                    "type": "string"
                },
                "link": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "ownerid": {
                    "type": "integer"
                },
                "projectid": {
                    "type": "integer"
                },
                "projectnumber": {
                    "type": "string"
                },
                "projecttitle": {
                    "type": "string"
                },
                "size": {
                    "type": "integer"
                }
            }
        },
        "handlers.FileUploadData": {
            "type": "object",
            "properties": {
                "fileid": {
                    "type": "integer",
                    "example": 123
                },
                "filesize": {
                    "type": "integer",
                    "example": 5242880
                },
                "folderid": {
                    "type": "integer",
                    "example": 456
                },
                "name": {
                    "type": "string",
                    "example": "document.pdf"
                }
            }
        },
        "handlers.FileUploadResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.FileUploadData"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.FolderGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.FolderResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.FolderListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.FolderResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.FolderResponse": {
            "type": "object",
            "properties": {
                "contacts": {
                    "type": "string",
                    "example": "1,2,3"
                },
                "date": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "description": {
                    "type": "string",
                    "example": "Assets for client review"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "itemid": {
                    "type": "integer",
                    "example": 5
                },
                "name": {
                    "type": "string",
                    "example": "Client Assets"
                },
                "ownerid": {
                    "type": "integer",
                    "example": 2
                },
                "projectid": {
                    "type": "integer",
                    "example": 10
                },
                "projectnumber": {
                    "type": "string",
                    "example": "PRJ-001"
                },
                "projecttitle": {
                    "type": "string",
                    "example": "Website Redesign"
                },
                "public": {
                    "type": "boolean",
                    "example": false
                },
                "size": {
                    "type": "integer",
                    "example": 204800
                },
                "type": {
                    "type": "string",
                    "example": "custom"
                }
            }
        },
        "handlers.GroupTeamItem": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Marketing Team"
                }
            }
        },
        "handlers.GroupsToContactsPayload": {
            "type": "object",
            "properties": {
                "groupid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.InvoiceGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.InvoiceResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.InvoiceItemCreatePayload": {
            "type": "object",
            "properties": {
                "billable": {
                    "type": "boolean"
                },
                "itemcollectionid": {
                    "type": "integer"
                },
                "itemtypeid": {
                    "type": "integer"
                },
                "name": {
                    "type": "string",
                    "example": "Homepage Design"
                },
                "parentid": {
                    "type": "integer"
                }
            }
        },
        "handlers.InvoiceItemGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.InvoiceItemResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.InvoiceItemListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.InvoiceItemResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.InvoiceItemResponse": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "description": "Status \u0026 scheduling",
                    "type": "integer"
                },
                "activeworkstate": {
                    "type": "string"
                },
                "billAmount": {
                    "description": "BillAmount is calculated based on BillType config",
                    "type": "number"
                },
                "billAmountTax": {
                    "description": "BillAmountTax is the tax on BillAmount, calculated based on BillType config",
                    "type": "number"
                },
                "billType": {
                    "description": "BillType determines how billAmount is calculated:\n0 = no bill amount, 1 = item rates and quantities, 2 = fixed fee, 3 = unit prices,\n4 = item rates, 5 = hours spent and quantities, 8 = hours spent",
                    "type": "integer"
                },
                "billable": {
                    "type": "boolean"
                },
                "budget": {
                    "description": "Budget is calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetTax": {
                    "description": "BudgetTax is the tax on Budget, calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetType": {
                    "description": "BudgetType determines how budget is calculated: 0 = no budget, 1 = item totals, 3 = unit prices, 4 = item rates",
                    "type": "integer"
                },
                "categoryid": {
                    "type": "integer"
                },
                "chargeRateType": {
                    "description": "ChargeRateType determines how output costs are calculated:\n1 (Single Rate) = use outLabourPrice; 2 (Split Rate) = use outLabourPrice of linked hourly rate services; 0 = no charge rate tracking",
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "costRateType": {
                    "description": "CostRateType determines how input costs are calculated:\n1 (Staff Rate) = use rate of linked staff members; 2 (Service Rate) = use rate of linked hourly rate services; 0 = no cost rate tracking",
                    "type": "string"
                },
                "createdatetime": {
                    "type": "string"
                },
                "creatorid": {
                    "type": "integer"
                },
                "deleted": {
                    "type": "boolean"
                },
                "discount": {
                    "type": "number"
                },
                "discountRate": {
                    "type": "number"
                },
                "estGrossMargin": {
                    "description": "EstGrossMargin = estProfit / estBillAmount % (to nearest whole number)",
                    "type": "number"
                },
                "estInLabour": {
                    "description": "EstInLabour is the estimated input labour amount ($); sum of estInLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estInTotal": {
                    "description": "EstInTotal is the estimated input/cost total = estInLabour + outUnitTotal",
                    "type": "number"
                },
                "estInTotalTax": {
                    "type": "number"
                },
                "estOutLabour": {
                    "description": "EstOutLabour is the estimated output labour amount ($); sum of estOutLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estProfit": {
                    "description": "EstProfit = estBillAmount - estInTotal = (estOutLabour + outUnitTotal) - (estInLabour + outUnitTotal)",
                    "type": "number"
                },
                "hourlyrateserviceid": {
                    "type": "integer"
                },
                "id": {
                    "description": "Core identity",
                    "type": "integer"
                },
                "inAccountingCodeId": {
                    "type": "integer"
                },
                "inLabourPrice": {
                    "description": "InLabourPrice is the internal (cost) price of labour for this item",
                    "type": "number"
                },
                "inTaxCodeId": {
                    "description": "Tax \u0026 accounting",
                    "type": "integer"
                },
                "inTaxRate": {
                    "type": "number"
                },
                "inUnitId": {
                    "description": "Units",
                    "type": "integer"
                },
                "inUnitPrice": {
                    "description": "Sensitive financial fields — pointer types required for NilSensitiveFields",
                    "type": "number"
                },
                "inUnitQty": {
                    "type": "number"
                },
                "inUnitTotal": {
                    "description": "InUnitTotal is the input unit line total = inUnitPrice * inUnitQty",
                    "type": "number"
                },
                "invoiceid": {
                    "description": "Relationships",
                    "type": "integer"
                },
                "isDiscountPercent": {
                    "type": "boolean"
                },
                "itemcollectionid": {
                    "type": "integer"
                },
                "itemtypeid": {
                    "type": "integer"
                },
                "lastmodifiedutc": {
                    "type": "string"
                },
                "manualBillAmount": {
                    "type": "number"
                },
                "manualBudget": {
                    "type": "number"
                },
                "name": {
                    "description": "Basic info",
                    "type": "string"
                },
                "outAccountingCodeId": {
                    "type": "integer"
                },
                "outLabourPrice": {
                    "description": "OutLabourPrice is the sale price for labour",
                    "type": "number"
                },
                "outLabourPriceMultiplier": {
                    "type": "number"
                },
                "outTaxCodeId": {
                    "type": "integer"
                },
                "outTaxRate": {
                    "type": "number"
                },
                "outUnitId": {
                    "type": "integer"
                },
                "outUnitPrice": {
                    "type": "number"
                },
                "outUnitPriceMultiplier": {
                    "type": "number"
                },
                "outUnitQty": {
                    "type": "number"
                },
                "outUnitTotal": {
                    "description": "OutUnitTotal is the output unit line total = outUnitPrice * outUnitQty",
                    "type": "number"
                },
                "parentid": {
                    "type": "integer"
                },
                "productid": {
                    "type": "integer"
                },
                "sortorder": {
                    "type": "string"
                },
                "timeBillable": {
                    "type": "number"
                },
                "timeallocated": {
                    "description": "Time",
                    "type": "number"
                },
                "timespent": {
                    "type": "number"
                },
                "trackingOptionId": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "uniquetoken": {
                    "type": "string"
                },
                "updatedAt": {
                    "type": "number"
                }
            }
        },
        "handlers.InvoiceItemUpdatePayload": {
            "type": "object",
            "properties": {
                "billAmount": {
                    "type": "number"
                },
                "billable": {
                    "type": "boolean"
                },
                "name": {
                    "type": "string",
                    "example": "Homepage Design"
                }
            }
        },
        "handlers.InvoiceListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.InvoiceResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.InvoicePhaseGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.InvoicePhaseResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.InvoicePhaseListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.InvoicePhaseResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.InvoicePhaseResponse": {
            "type": "object",
            "properties": {
                "billAmount": {
                    "description": "BillAmount is calculated based on BillType config",
                    "type": "number"
                },
                "billAmountTax": {
                    "description": "BillAmountTax is the tax on BillAmount, calculated based on BillType config",
                    "type": "number"
                },
                "billType": {
                    "description": "BillType determines how billAmount is calculated:\n0 = no bill amount, 1 = item rates and quantities, 2 = fixed fee, 3 = unit prices,\n4 = item rates, 5 = hours spent and quantities, 8 = hours spent",
                    "type": "integer"
                },
                "budget": {
                    "description": "Budget is calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetTax": {
                    "description": "BudgetTax is the tax on Budget, calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetType": {
                    "description": "BudgetType determines how budget is calculated: 0 = no budget, 1 = item totals, 3 = unit prices, 4 = item rates",
                    "type": "integer"
                },
                "datecreated": {
                    "type": "string",
                    "example": "2024-01-10T09:00:00"
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "discount": {
                    "type": "number"
                },
                "estGrossMargin": {
                    "description": "EstGrossMargin = estProfit / estBillAmount % (to nearest whole number)",
                    "type": "number"
                },
                "estInLabour": {
                    "description": "EstInLabour is the estimated input labour amount ($); sum of estInLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estInTotal": {
                    "description": "EstInTotal is the estimated input/cost total = estInLabour + outUnitTotal",
                    "type": "number"
                },
                "estInTotalTax": {
                    "type": "number"
                },
                "estOutLabour": {
                    "description": "EstOutLabour is the estimated output labour amount ($); sum of estOutLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estProfit": {
                    "description": "EstProfit = estBillAmount - estInTotal = (estOutLabour + outUnitTotal) - (estInLabour + outUnitTotal)",
                    "type": "number"
                },
                "id": {
                    "description": "Core identity",
                    "type": "integer",
                    "example": 5
                },
                "inUnitTotal": {
                    "description": "InUnitTotal is the input unit line total = inUnitPrice * inUnitQty",
                    "type": "number"
                },
                "invoiceid": {
                    "description": "Relationships",
                    "type": "integer",
                    "example": 42
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "description": "Basic info",
                    "type": "string",
                    "example": "Phase 1"
                },
                "outUnitTotal": {
                    "description": "OutUnitTotal is the output unit line total = outUnitPrice * outUnitQty",
                    "type": "number"
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "projectedInLabour": {
                    "type": "number"
                },
                "projectedInTotal": {
                    "type": "number"
                },
                "timeBillable": {
                    "description": "Sensitive financial fields — pointer types required for NilSensitiveFields",
                    "type": "number"
                },
                "timeallocated": {
                    "description": "Time (non-sensitive)",
                    "type": "number"
                }
            }
        },
        "handlers.InvoiceResponse": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 1
                },
                "activeworkstate": {
                    "description": "Status",
                    "type": "string",
                    "example": "draft"
                },
                "address1": {
                    "description": "Address (single-get only)",
                    "type": "string",
                    "example": "123 Main Street"
                },
                "address2": {
                    "type": "string",
                    "example": "Suite 100"
                },
                "address3": {
                    "type": "string",
                    "example": ""
                },
                "billAmount": {
                    "type": "number",
                    "example": 5000
                },
                "billAmountTax": {
                    "description": "BillAmountTax is the tax on BillAmount, calculated based on BillType config",
                    "type": "number",
                    "example": 5750
                },
                "billType": {
                    "description": "BillType determines how billAmount is calculated:\n0 = no bill amount, 1 = item totals, 2 = fixed fee, 3 = unit prices,\n4 = item labour values, 5 = time spent, 6 = fixed amount per phase,\n7 = fixed amount per project, 8 = item labour values (tracked time only)",
                    "type": "integer",
                    "example": 1
                },
                "budget": {
                    "type": "number",
                    "example": 5000
                },
                "budgetTax": {
                    "description": "BudgetTax is the tax on Budget, calculated based on BudgetType config",
                    "type": "number",
                    "example": 5750
                },
                "budgetType": {
                    "description": "BudgetType determines how budget is calculated: 0 = no budget, 1 = item totals",
                    "type": "integer",
                    "example": 1
                },
                "city": {
                    "type": "string",
                    "example": "New York"
                },
                "clientcontactname": {
                    "description": "Client details (single-get only)",
                    "type": "string",
                    "example": "John Doe"
                },
                "companyid": {
                    "description": "Company",
                    "type": "integer",
                    "example": 5
                },
                "companyname": {
                    "type": "string",
                    "example": "Acme Corp"
                },
                "country": {
                    "type": "string",
                    "example": "United States"
                },
                "customfieldname": {
                    "type": "string",
                    "example": "Reference"
                },
                "customfieldvalue": {
                    "type": "string",
                    "example": "REF-001"
                },
                "description": {
                    "description": "Description (requires Invoices JOIN)",
                    "type": "string",
                    "example": "Invoice for website design services"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15T00:00:00"
                },
                "emaileddate": {
                    "type": "string",
                    "example": "2024-01-16T00:00:00"
                },
                "emailedto": {
                    "type": "string",
                    "example": "client@example.com"
                },
                "emailedtoclient": {
                    "description": "Flags",
                    "type": "boolean",
                    "example": true
                },
                "grandtotal": {
                    "type": "number",
                    "example": 1150
                },
                "id": {
                    "type": "integer",
                    "example": 42
                },
                "invoicedby": {
                    "description": "Invoiced by (contact name)",
                    "type": "string",
                    "example": "Jane Doe"
                },
                "invoiceddate": {
                    "description": "Dates",
                    "type": "string",
                    "example": "2024-01-15T00:00:00"
                },
                "invoicetermid": {
                    "description": "Payment terms (single-get only)",
                    "type": "integer",
                    "example": 1
                },
                "itemsDiscount": {
                    "description": "Financial detail (sensitive; single-get and fields=all only)",
                    "type": "number",
                    "example": 0
                },
                "lastmodifiedutc": {
                    "description": "Audit",
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "number": {
                    "description": "Core",
                    "type": "string",
                    "example": "INV-001"
                },
                "pagetitle": {
                    "type": "string",
                    "example": "Invoice"
                },
                "paid": {
                    "type": "boolean",
                    "example": false
                },
                "paiddate": {
                    "type": "string",
                    "example": "2024-02-10T00:00:00"
                },
                "paymentterms": {
                    "type": "string",
                    "example": "Net 30"
                },
                "phases": {
                    "description": "Sub-entities — populated only when IncludePhases=true (via OUTER APPLY in main query)",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.InvoiceSubPhaseItem"
                    }
                },
                "projectid": {
                    "description": "Project",
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "projectnumbers": {
                    "type": "string",
                    "example": "PRJ-001"
                },
                "projecttitles": {
                    "type": "string",
                    "example": "Website Redesign"
                },
                "purchaseordernumber": {
                    "description": "Other",
                    "type": "string",
                    "example": "PO-12345"
                },
                "showcostbreakdown": {
                    "type": "boolean",
                    "example": false
                },
                "showitemdescription": {
                    "type": "boolean",
                    "example": true
                },
                "showphases": {
                    "type": "boolean",
                    "example": true
                },
                "state": {
                    "type": "string",
                    "example": "NY"
                },
                "subtotal": {
                    "description": "Financial totals",
                    "type": "number",
                    "example": 1000
                },
                "taxable": {
                    "description": "Tax (requires JOINs)",
                    "type": "boolean",
                    "example": true
                },
                "taxrate": {
                    "type": "number",
                    "example": 15
                },
                "taxtotal": {
                    "type": "number",
                    "example": 150
                },
                "template": {
                    "type": "boolean",
                    "example": false
                },
                "timeBillable": {
                    "description": "TimeBillable is the aggregate sum of ItemAllocation.timeBillable",
                    "type": "integer",
                    "example": 480
                },
                "title": {
                    "type": "string",
                    "example": "Website Design Invoice"
                },
                "zipcode": {
                    "type": "string",
                    "example": "10001"
                }
            }
        },
        "handlers.InvoiceSubItemItem": {
            "type": "object",
            "properties": {
                "activeworkstate": {
                    "type": "string",
                    "example": "active"
                },
                "billAmount": {
                    "type": "number",
                    "example": 1000
                },
                "billAmountTax": {
                    "type": "number",
                    "example": 1150
                },
                "billType": {
                    "type": "integer",
                    "example": 1
                },
                "billable": {
                    "type": "boolean",
                    "example": true
                },
                "budget": {
                    "type": "number",
                    "example": 1000
                },
                "budgetTax": {
                    "type": "number",
                    "example": 1150
                },
                "budgetType": {
                    "type": "integer",
                    "example": 1
                },
                "code": {
                    "type": "string",
                    "example": "ITEM-001"
                },
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "discount": {
                    "type": "number",
                    "example": 0
                },
                "estInTotal": {
                    "type": "number",
                    "example": 500
                },
                "estInTotalTax": {
                    "type": "number",
                    "example": 575
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "inUnitTotal": {
                    "type": "number",
                    "example": 500
                },
                "invoiceid": {
                    "type": "integer",
                    "example": 42
                },
                "itemcollectionid": {
                    "type": "integer",
                    "example": 5
                },
                "itemtypeid": {
                    "type": "integer",
                    "example": 1
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "type": "string",
                    "example": "Web Design"
                },
                "outUnitTotal": {
                    "type": "number",
                    "example": 1000
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "timeBillable": {
                    "type": "integer",
                    "example": 120
                },
                "timeallocated": {
                    "type": "integer",
                    "example": 120
                },
                "trackingOptionId": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                }
            }
        },
        "handlers.InvoiceSubPhaseItem": {
            "type": "object",
            "properties": {
                "billAmount": {
                    "type": "number",
                    "example": 5000
                },
                "billAmountTax": {
                    "type": "number",
                    "example": 5750
                },
                "billType": {
                    "type": "integer",
                    "example": 1
                },
                "budget": {
                    "type": "number",
                    "example": 5000
                },
                "budgetTax": {
                    "type": "number",
                    "example": 5750
                },
                "budgetType": {
                    "type": "integer",
                    "example": 1
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "discount": {
                    "type": "number",
                    "example": 0
                },
                "estGrossMargin": {
                    "type": "number",
                    "example": 60
                },
                "estInLabour": {
                    "type": "number",
                    "example": 2000
                },
                "estInTotal": {
                    "type": "number",
                    "example": 2000
                },
                "estInTotalTax": {
                    "type": "number",
                    "example": 2300
                },
                "estOutLabour": {
                    "type": "number",
                    "example": 5000
                },
                "estProfit": {
                    "type": "number",
                    "example": 3000
                },
                "id": {
                    "type": "integer",
                    "example": 5
                },
                "inUnitTotal": {
                    "type": "number",
                    "example": 2000
                },
                "invoiceid": {
                    "type": "integer",
                    "example": 42
                },
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.InvoiceSubItemItem"
                    }
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "type": "string",
                    "example": "Phase 1"
                },
                "outUnitTotal": {
                    "type": "number",
                    "example": 5000
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "projectedInLabour": {
                    "type": "number",
                    "example": 2000
                },
                "projectedInTotal": {
                    "type": "number",
                    "example": 2000
                },
                "timeBillable": {
                    "type": "integer",
                    "example": 480
                },
                "timeallocated": {
                    "type": "integer",
                    "example": 480
                }
            }
        },
        "handlers.InvoiceTemplateListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.InvoiceTemplateResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.InvoiceTemplateResponse": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "taxable": {
                    "type": "boolean",
                    "example": true
                },
                "taxrate": {
                    "type": "number",
                    "example": 15
                },
                "title": {
                    "type": "string",
                    "example": "Standard Invoice"
                }
            }
        },
        "handlers.InvoiceWorkStageHistoryListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.InvoiceWorkStageHistoryResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.InvoiceWorkStageHistoryResponse": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "integer",
                    "example": 10
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "invoiceid": {
                    "type": "integer",
                    "example": 42
                },
                "name": {
                    "type": "string",
                    "example": "Approved"
                },
                "setdatetime": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "workstageid": {
                    "type": "integer",
                    "example": 3
                }
            }
        },
        "handlers.ItemCategoryGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ItemCategoryResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ItemCategoryListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ItemCategoryResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ItemCategoryResponse": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "id": {
                    "type": "integer"
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "type": "string",
                    "example": "Design"
                },
                "sortorder": {
                    "type": "string",
                    "example": "1"
                }
            }
        },
        "handlers.ItemTagGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ItemTagResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ItemTagListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ItemTagResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ItemTagResponse": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "id": {
                    "type": "integer"
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "type": "string",
                    "example": "Urgent"
                }
            }
        },
        "handlers.ItemWorkStageHistoryListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ItemWorkStageHistoryResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ItemWorkStageHistoryResponse": {
            "type": "object",
            "properties": {
                "active": {
                    "type": "boolean",
                    "example": true
                },
                "contactid": {
                    "type": "integer",
                    "example": 10
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "itemcontactid": {
                    "type": "string",
                    "example": "10"
                },
                "itemid": {
                    "type": "integer",
                    "example": 5
                },
                "name": {
                    "type": "string",
                    "example": "In Progress"
                },
                "setdatetime": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "workstageid": {
                    "type": "integer",
                    "example": 3
                }
            }
        },
        "handlers.ItemsToTagsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "itemid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.LicenseDetails": {
            "type": "object",
            "properties": {
                "available": {
                    "type": "integer",
                    "example": 90
                },
                "total": {
                    "type": "integer",
                    "example": 100
                },
                "used": {
                    "type": "integer",
                    "example": 10
                }
            }
        },
        "handlers.LicenseGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.LicenseDetails"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.LooknfeelListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.LooknfeelResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.LooknfeelResponse": {
            "type": "object",
            "properties": {
                "colorscheme": {
                    "type": "string",
                    "example": "blue"
                },
                "headerprimary": {
                    "type": "string",
                    "example": "#1A5276"
                },
                "headersecondary": {
                    "type": "string",
                    "example": "#2E86C1"
                },
                "headertext": {
                    "type": "string",
                    "example": "#FFFFFF"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "linktext": {
                    "type": "string",
                    "example": "#1A5276"
                },
                "logo": {
                    "type": "string",
                    "example": "https://example.com/img/logo.png"
                },
                "tab": {
                    "type": "string",
                    "example": "#1A5276"
                },
                "tabhover": {
                    "type": "string",
                    "example": "#2E86C1"
                }
            }
        },
        "handlers.MeDetailResponse": {
            "type": "object",
            "properties": {
                "address1": {
                    "type": "string",
                    "example": "123 Main St"
                },
                "address2": {
                    "type": "string",
                    "example": "Suite 100"
                },
                "address3": {
                    "type": "string",
                    "example": ""
                },
                "allowlogin": {
                    "type": "boolean",
                    "example": true
                },
                "city": {
                    "type": "string",
                    "example": "New York"
                },
                "companyid": {
                    "type": "integer",
                    "example": 1
                },
                "companyname": {
                    "type": "string",
                    "example": "Acme Corp"
                },
                "country": {
                    "type": "string",
                    "example": "USA"
                },
                "defaulthourlyrateid": {
                    "type": "integer",
                    "example": 1
                },
                "divisionid": {
                    "type": "integer",
                    "example": 1
                },
                "email": {
                    "type": "string",
                    "example": "john@example.com"
                },
                "fax": {
                    "type": "string",
                    "example": "123-456-7892"
                },
                "firstname": {
                    "type": "string",
                    "example": "John"
                },
                "groups": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactSubGroup"
                    }
                },
                "ianatimezone": {
                    "type": "string",
                    "example": "Pacific/Auckland"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "image": {
                    "type": "string",
                    "example": "https://cdn.proworkflow.com/images/contact/1.jpg"
                },
                "invoicesplugin": {
                    "type": "boolean",
                    "example": true
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-15T15:30:00"
                },
                "lastname": {
                    "type": "string",
                    "example": "Smith"
                },
                "mobilephone": {
                    "type": "string",
                    "example": "123-456-7891"
                },
                "notes": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactSubNote"
                    }
                },
                "payrate": {
                    "type": "number",
                    "example": 50
                },
                "payratemultiplier": {
                    "type": "number",
                    "example": 1.5
                },
                "pending": {
                    "type": "boolean",
                    "example": false
                },
                "plan": {
                    "type": "string",
                    "example": "Advanced"
                },
                "quotesplugin": {
                    "type": "boolean",
                    "example": true
                },
                "roles": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactSubRole"
                    }
                },
                "state": {
                    "type": "string",
                    "example": "NY"
                },
                "status": {
                    "type": "string",
                    "example": "active"
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactSubTag"
                    }
                },
                "teams": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ContactSubTeam"
                    }
                },
                "title": {
                    "type": "string",
                    "example": "CEO"
                },
                "type": {
                    "type": "string",
                    "example": "staff"
                },
                "username": {
                    "type": "string",
                    "example": "jsmith"
                },
                "workphone": {
                    "type": "string",
                    "example": "123-456-7890"
                },
                "zipcode": {
                    "type": "string",
                    "example": "10001"
                }
            }
        },
        "handlers.MeGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.MeDetailResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.MessageContactsPayload": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        4,
                        5,
                        6
                    ]
                },
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.MessageGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.MessageResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.MessageListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.MessageResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.MessageReplyItem": {
            "type": "object",
            "properties": {
                "authorid": {
                    "type": "integer",
                    "example": 3
                },
                "authorimage": {
                    "type": "string",
                    "example": "https://example.com/img/contactimages/john.png"
                },
                "authorname": {
                    "type": "string",
                    "example": "John Smith"
                },
                "authortype": {
                    "type": "string",
                    "example": "staff"
                },
                "content": {
                    "type": "string",
                    "example": "Thanks for the update."
                },
                "date": {
                    "type": "string",
                    "example": "2024-01-18T14:00:00"
                },
                "files": {
                    "type": "string",
                    "example": "10,11"
                },
                "id": {
                    "type": "integer",
                    "example": 2
                }
            }
        },
        "handlers.MessageResponse": {
            "type": "object",
            "properties": {
                "authoremail": {
                    "type": "string",
                    "example": "jane@example.com"
                },
                "authorid": {
                    "type": "integer",
                    "example": 2
                },
                "authorimage": {
                    "type": "string",
                    "example": "https://example.com/img/contactimages/jane.png"
                },
                "authorname": {
                    "type": "string",
                    "example": "Jane Smith"
                },
                "authortype": {
                    "type": "string",
                    "example": "staff"
                },
                "contacts": {
                    "type": "string",
                    "example": "1,2,3"
                },
                "content": {
                    "type": "string",
                    "example": "Here is the latest update..."
                },
                "date": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "files": {
                    "type": "string",
                    "example": "10,11"
                },
                "filesenabled": {
                    "type": "string",
                    "example": "true"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "itemid": {
                    "type": "integer",
                    "example": 5
                },
                "itemname": {
                    "type": "string",
                    "example": "Design mockups"
                },
                "originalmessageid": {
                    "type": "integer",
                    "example": 0
                },
                "projectcontacts": {
                    "type": "string",
                    "example": "1,2,3"
                },
                "projectid": {
                    "type": "integer",
                    "example": 10
                },
                "projectmanagerid": {
                    "type": "integer",
                    "example": 2
                },
                "projectmanagername": {
                    "type": "string",
                    "example": "Jane Smith"
                },
                "projectnumber": {
                    "type": "string",
                    "example": "PRJ-001"
                },
                "projecttitle": {
                    "type": "string",
                    "example": "Website Redesign"
                },
                "public": {
                    "type": "boolean",
                    "example": false
                },
                "replies": {
                    "description": "Sub-entities — populated only when IncludeReplies=true (single-get always; list opt-in)",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.MessageReplyItem"
                    }
                },
                "replycount": {
                    "type": "integer",
                    "example": 3
                },
                "subject": {
                    "type": "string",
                    "example": "Project update"
                }
            }
        },
        "handlers.MoveItemsRequest": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "itemcollectionid": {
                    "type": "integer",
                    "example": 456
                }
            }
        },
        "handlers.PermissionSettingsListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.PermissionSettingsResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.PermissionSettingsResponse": {
            "type": "object",
            "properties": {
                "description": {
                    "type": "string",
                    "example": "Allows user to create and manage companies"
                },
                "id": {
                    "type": "integer",
                    "example": 8
                },
                "name": {
                    "type": "string",
                    "example": "Manage Companies"
                },
                "viewonly": {
                    "type": "boolean",
                    "example": false
                }
            }
        },
        "handlers.PhaseCreatePayload": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "example": "Design Phase"
                },
                "parentid": {
                    "type": "integer"
                },
                "projectid": {
                    "type": "integer"
                },
                "sortorder": {
                    "type": "integer"
                }
            }
        },
        "handlers.PhaseUpdatePayload": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "example": "Design Phase"
                },
                "parentid": {
                    "type": "integer"
                },
                "sortorder": {
                    "type": "integer"
                }
            }
        },
        "handlers.PrerequisitesToItemsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "prerequisiteid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.ProjectAccessDetailsResult": {
            "type": "object",
            "properties": {
                "number": {
                    "type": "string",
                    "example": "PRJ-001"
                },
                "title": {
                    "type": "string",
                    "example": "Website Redesign"
                }
            }
        },
        "handlers.ProjectAccessResponse": {
            "type": "object",
            "properties": {
                "access": {
                    "type": "boolean"
                },
                "details": {
                    "$ref": "#/definitions/handlers.ProjectAccessDetailsResult"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectBookmarkGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ProjectBookmarkResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectBookmarkItem": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "projectid": {
                    "type": "integer",
                    "example": 1
                },
                "title": {
                    "type": "string",
                    "example": "Project Reference"
                },
                "url": {
                    "type": "string",
                    "example": "https://www.example.com"
                }
            }
        },
        "handlers.ProjectBookmarkListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectBookmarkResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectBookmarkResponse": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "projectid": {
                    "type": "integer",
                    "example": 10
                },
                "title": {
                    "type": "string",
                    "example": "Example Site"
                },
                "url": {
                    "type": "string",
                    "example": "https://example.com"
                }
            }
        },
        "handlers.ProjectCategoryGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ProjectCategoryResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectCategoryListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectCategoryResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectCategoryResponse": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "id": {
                    "type": "integer"
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "type": "string",
                    "example": "Marketing"
                },
                "projectcount": {
                    "type": "integer",
                    "example": 5
                },
                "sortorder": {
                    "type": "string",
                    "example": "1"
                }
            }
        },
        "handlers.ProjectContactItem": {
            "type": "object",
            "properties": {
                "firstname": {
                    "type": "string",
                    "example": "John"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "lastname": {
                    "type": "string",
                    "example": "Smith"
                },
                "name": {
                    "type": "string",
                    "example": "John Smith"
                },
                "type": {
                    "type": "string",
                    "example": "staff"
                }
            }
        },
        "handlers.ProjectCustomFieldInput": {
            "type": "object",
            "properties": {
                "customfieldid": {
                    "description": "ID of the custom field definition.",
                    "type": "integer",
                    "example": 1
                },
                "customfieldoptionid": {
                    "description": "Option ID for dropdown type fields. Alternatively pass the option ID as value.",
                    "type": "integer",
                    "example": 5
                },
                "type": {
                    "description": "Type of the custom field.",
                    "type": "string",
                    "enum": [
                        "checkbox",
                        "date",
                        "dropdown",
                        "number",
                        "percentage",
                        "rating",
                        "staff",
                        "text"
                    ],
                    "example": "text"
                },
                "value": {
                    "description": "Value for the custom field. Pass as a string for checkbox (\"checked\"/\"unchecked\"),\ndate (\"YYYY-MM-DD\"), rating, and text types. Pass as a number for number, percentage,\nstaff (contact ID), and dropdown (customfieldoption ID) types.",
                    "type": "string",
                    "example": "some text"
                }
            }
        },
        "handlers.ProjectCustomFieldItem": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Priority Level"
                },
                "type": {
                    "type": "string",
                    "example": "dropdown"
                },
                "value": {
                    "type": "string",
                    "example": "High"
                },
                "valuename": {
                    "type": "string",
                    "example": "High Priority"
                }
            }
        },
        "handlers.ProjectFileItem": {
            "type": "object",
            "properties": {
                "description": {
                    "type": "string",
                    "example": "Homepage design mockup"
                },
                "folderid": {
                    "type": "integer",
                    "example": 1
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "modified": {
                    "type": "string",
                    "example": "2024-01-15T10:00:00"
                },
                "name": {
                    "type": "string",
                    "example": "homepage-mockup.pdf"
                },
                "ownerid": {
                    "type": "integer",
                    "example": 1
                },
                "projectid": {
                    "type": "integer",
                    "example": 1
                },
                "size": {
                    "type": "integer",
                    "example": 204800
                },
                "taskid": {
                    "type": "integer",
                    "example": 1
                },
                "uniquetoken": {
                    "type": "string",
                    "example": "abc123"
                }
            }
        },
        "handlers.ProjectFolderItem": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "description": {
                    "type": "string",
                    "example": "All design-related files"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "modified": {
                    "type": "string",
                    "example": "2024-01-15T10:00:00"
                },
                "name": {
                    "type": "string",
                    "example": "Design Assets"
                },
                "ownerid": {
                    "type": "integer",
                    "example": 1
                },
                "projectid": {
                    "type": "integer",
                    "example": 1
                },
                "public": {
                    "type": "boolean",
                    "example": true
                },
                "size": {
                    "type": "integer",
                    "example": 1048576
                },
                "taskid": {
                    "type": "integer",
                    "example": 0
                },
                "type": {
                    "type": "string",
                    "example": "project"
                }
            }
        },
        "handlers.ProjectGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ProjectResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectInvoiceItem": {
            "type": "object",
            "properties": {
                "activeworkstate": {
                    "type": "string",
                    "example": "draft"
                },
                "companyid": {
                    "type": "integer",
                    "example": 5
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "grandtotal": {
                    "type": "number",
                    "example": 1150
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "invoicedate": {
                    "type": "string",
                    "example": "2024-01-15"
                },
                "number": {
                    "type": "string",
                    "example": "INV-001"
                },
                "paid": {
                    "type": "boolean",
                    "example": false
                },
                "paiddate": {
                    "type": "string",
                    "example": ""
                },
                "projectid": {
                    "type": "integer",
                    "example": 1
                },
                "subtotal": {
                    "type": "number",
                    "example": 1000
                },
                "title": {
                    "type": "string",
                    "example": "Website Design Invoice"
                }
            }
        },
        "handlers.ProjectItemGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ProjectItemResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectItemListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectItemResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectItemResponse": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "description": "Status \u0026 scheduling",
                    "type": "integer"
                },
                "activeworkstate": {
                    "type": "string"
                },
                "actualInLabour": {
                    "description": "Actual (sensitive)\nActualInLabour is the actual input labour amount = inLabourPrice * timeSpent/60",
                    "type": "number"
                },
                "actualInTotal": {
                    "description": "ActualInTotal is the actual input/cost total = actualInLabour + outUnitTotal",
                    "type": "number"
                },
                "actualInTotalTax": {
                    "type": "number"
                },
                "actualOutLabour": {
                    "description": "ActualOutLabour is the actual output labour amount = outLabourPrice * timeSpent/60",
                    "type": "number"
                },
                "actualProfit": {
                    "description": "ActualProfit = projectedBillAmount - actualInTotal = (actualOutLabour + outUnitTotal) - (actualInLabour + outUnitTotal)",
                    "type": "number"
                },
                "billAmount": {
                    "description": "BillAmount is calculated based on BillType config",
                    "type": "number"
                },
                "billAmountTax": {
                    "description": "BillAmountTax is the tax on BillAmount, calculated based on BillType config",
                    "type": "number"
                },
                "billType": {
                    "description": "BillType determines how billAmount is calculated:\n0 = no bill amount, 1 = item rates and quantities, 2 = fixed fee, 3 = unit prices,\n4 = item rates, 5 = hours spent and quantities, 8 = hours spent",
                    "type": "integer"
                },
                "billable": {
                    "type": "boolean"
                },
                "budget": {
                    "description": "Budget is calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetTax": {
                    "description": "BudgetTax is the tax on Budget, calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetType": {
                    "description": "BudgetType determines how budget is calculated: 0 = no budget, 1 = item totals, 3 = unit prices, 4 = item rates",
                    "type": "integer"
                },
                "categoryid": {
                    "type": "integer"
                },
                "chargeRateType": {
                    "description": "ChargeRateType determines how output costs are calculated:\n1 (Single Rate) = use outLabourPrice; 2 (Split Rate) = use outLabourPrice of linked hourly rate services; 0 = no charge rate tracking",
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "companyid": {
                    "type": "integer"
                },
                "companyname": {
                    "type": "string"
                },
                "completedate": {
                    "type": "string"
                },
                "contactid": {
                    "description": "Relationship ID arrays",
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "contacts": {
                    "description": "JSON array fields (OUTER APPLY)",
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "costRateType": {
                    "description": "CostRateType determines how input costs are calculated:\n1 (Staff Rate) = use rate of linked staff members; 2 (Service Rate) = use rate of linked hourly rate services; 0 = no cost rate tracking",
                    "type": "string"
                },
                "createdatetime": {
                    "type": "string"
                },
                "creatorid": {
                    "type": "integer"
                },
                "deleted": {
                    "type": "boolean"
                },
                "dependenttaskid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "description": {
                    "type": "string"
                },
                "discount": {
                    "description": "Discount (sensitive)",
                    "type": "number"
                },
                "discountRate": {
                    "type": "number"
                },
                "duedate": {
                    "type": "string"
                },
                "effortScoreId": {
                    "type": "integer"
                },
                "estBillAmount": {
                    "description": "EstBillAmount represents billAmount without using actual values (always estimated)",
                    "type": "number"
                },
                "estBillAmountTax": {
                    "description": "EstBillAmountTax is the tax on estBillAmount",
                    "type": "number"
                },
                "estGrossMargin": {
                    "description": "EstGrossMargin = estProfit / estBillAmount % (to nearest whole number)",
                    "type": "number"
                },
                "estInLabour": {
                    "description": "Estimated (sensitive)\nEstInLabour is the estimated input labour amount ($); sum of estInLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estInTotal": {
                    "description": "EstInTotal is the estimated input/cost total = estInLabour + outUnitTotal",
                    "type": "number"
                },
                "estInTotalTax": {
                    "type": "number"
                },
                "estOutLabour": {
                    "description": "EstOutLabour is the estimated output labour amount ($); sum of estOutLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estProfit": {
                    "description": "Profit (sensitive)\nEstProfit = estBillAmount - estInTotal = (estOutLabour + outUnitTotal) - (estInLabour + outUnitTotal)",
                    "type": "number"
                },
                "hourlyrateserviceid": {
                    "type": "integer"
                },
                "id": {
                    "description": "Core identity",
                    "type": "integer"
                },
                "impactScoreId": {
                    "type": "integer"
                },
                "importanceScoreId": {
                    "type": "integer"
                },
                "inAccountingCodeId": {
                    "type": "integer"
                },
                "inLabourPrice": {
                    "description": "InLabourPrice is the internal (cost) price of labour for this item",
                    "type": "number"
                },
                "inTaxCodeId": {
                    "type": "integer"
                },
                "inTaxRate": {
                    "type": "number"
                },
                "inUnitId": {
                    "description": "Units \u0026 tax",
                    "type": "integer"
                },
                "inUnitPrice": {
                    "type": "number"
                },
                "inUnitQty": {
                    "type": "number"
                },
                "inUnitTotal": {
                    "description": "InUnitTotal is the input unit line total = inUnitPrice * inUnitQty",
                    "type": "number"
                },
                "invoicedAmount": {
                    "description": "Invoiced\nInvoicedAmount is the dollar value that has been invoiced (may span multiple invoices)",
                    "type": "number"
                },
                "invoicedAmountTax": {
                    "description": "InvoicedAmountTax is the tax amount that has been invoiced (may span multiple invoices)",
                    "type": "number"
                },
                "invoiceitemid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "isDiscountPercent": {
                    "type": "boolean"
                },
                "itemcollectionid": {
                    "type": "integer"
                },
                "itemtypeid": {
                    "type": "integer"
                },
                "lastmodifiedutc": {
                    "type": "string"
                },
                "manualBillAmount": {
                    "description": "Billing (sensitive)",
                    "type": "number"
                },
                "manualBudget": {
                    "description": "Budget (sensitive)",
                    "type": "number"
                },
                "manualPercentageComplete": {
                    "type": "number"
                },
                "name": {
                    "description": "Basic info",
                    "type": "string"
                },
                "number": {
                    "type": "integer"
                },
                "outAccountingCodeId": {
                    "type": "integer"
                },
                "outLabourPrice": {
                    "description": "Units/pricing (sensitive)\nOutLabourPrice is the sale price for labour",
                    "type": "number"
                },
                "outLabourPriceMultiplier": {
                    "type": "number"
                },
                "outTaxCodeId": {
                    "type": "integer"
                },
                "outTaxRate": {
                    "type": "number"
                },
                "outUnitId": {
                    "type": "integer"
                },
                "outUnitPrice": {
                    "type": "number"
                },
                "outUnitPriceMultiplier": {
                    "type": "number"
                },
                "outUnitQty": {
                    "type": "number"
                },
                "outUnitTotal": {
                    "description": "OutUnitTotal is the output unit line total = outUnitPrice * outUnitQty",
                    "type": "number"
                },
                "paidAmount": {
                    "description": "PaidAmount is the dollar value in invoices marked as paid (may span multiple invoices)",
                    "type": "number"
                },
                "paidAmountTax": {
                    "description": "PaidAmountTax is the tax amount that has been paid (may span multiple invoices)",
                    "type": "number"
                },
                "parentid": {
                    "type": "integer"
                },
                "phasename": {
                    "type": "string"
                },
                "prerequisiteid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "priorityid": {
                    "type": "integer"
                },
                "productid": {
                    "type": "integer"
                },
                "projectedBillAmount": {
                    "description": "Projected billing (sensitive)\nProjectedBillAmount represents billAmount adjusted for projectedOutTotal values",
                    "type": "number"
                },
                "projectedBillAmountTax": {
                    "description": "ProjectedBillAmountTax is the tax on projectedBillAmount",
                    "type": "number"
                },
                "projectedGrossMargin": {
                    "description": "ProjectedGrossMargin = projectedProfit / projectedOutTotal % (to nearest whole number)",
                    "type": "number"
                },
                "projectedInLabour": {
                    "description": "Projections",
                    "type": "number"
                },
                "projectedInTotal": {
                    "type": "number"
                },
                "projectedOutLabour": {
                    "type": "number"
                },
                "projectedProfit": {
                    "description": "ProjectedProfit = estBillAmount - projectedInTotal (difference between expected total revenue and projected costs)",
                    "type": "number"
                },
                "projectedTimeManual": {
                    "type": "number"
                },
                "projectedTimeSpent": {
                    "type": "number"
                },
                "projectid": {
                    "description": "Relationships",
                    "type": "integer"
                },
                "projectnumber": {
                    "type": "string"
                },
                "projecttitle": {
                    "type": "string"
                },
                "quoteitemid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "startdate": {
                    "type": "string"
                },
                "storyPoints": {
                    "description": "Scoring",
                    "type": "integer"
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "timeBillable": {
                    "type": "integer"
                },
                "timeallocated": {
                    "description": "Time",
                    "type": "integer"
                },
                "timespent": {
                    "type": "integer"
                },
                "trackingOptionId": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "uniquetoken": {
                    "type": "string"
                },
                "urgencyScoreId": {
                    "type": "integer"
                }
            }
        },
        "handlers.ProjectListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectManagementTeam": {
            "type": "object",
            "properties": {
                "groupid": {
                    "type": "integer",
                    "example": 1
                },
                "managerid": {
                    "type": "integer",
                    "example": 1
                },
                "teamid": {
                    "type": "integer",
                    "example": 1
                }
            }
        },
        "handlers.ProjectMessageItem": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1
                    ]
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "itemid": {
                    "type": "integer",
                    "example": 1
                },
                "projectid": {
                    "type": "integer",
                    "example": 1
                },
                "public": {
                    "type": "boolean",
                    "example": true
                },
                "replycount": {
                    "type": "integer",
                    "example": 3
                },
                "senddate": {
                    "type": "string",
                    "example": "2024-01-15T10:00:00"
                },
                "senderid": {
                    "type": "integer",
                    "example": 1
                },
                "shortdetails": {
                    "type": "string",
                    "example": "Homepage design is complete"
                },
                "subject": {
                    "type": "string",
                    "example": "Project update"
                },
                "type": {
                    "type": "string",
                    "example": "message"
                }
            }
        },
        "handlers.ProjectNoteCreatePayload": {
            "type": "object",
            "properties": {
                "content": {
                    "type": "string",
                    "example": "Discussed homepage layout and colour palette."
                },
                "description": {
                    "type": "string",
                    "example": "Notes from the 15 Jan kickoff meeting."
                },
                "projectid": {
                    "type": "integer"
                },
                "title": {
                    "type": "string",
                    "example": "Meeting Notes"
                }
            }
        },
        "handlers.ProjectNoteListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectNoteResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectNoteResponse": {
            "type": "object",
            "properties": {
                "companyid": {
                    "type": "integer",
                    "example": 5
                },
                "companyname": {
                    "type": "string",
                    "example": "Acme Corp"
                },
                "content": {
                    "type": "string",
                    "example": "Discussed homepage layout and colour palette."
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-15T15:30:00"
                },
                "projectid": {
                    "type": "integer",
                    "example": 1
                },
                "projectnumber": {
                    "type": "string",
                    "example": "PRJ-001"
                },
                "projecttitle": {
                    "type": "string",
                    "example": "Website Redesign"
                },
                "title": {
                    "type": "string",
                    "example": "Meeting Notes"
                }
            }
        },
        "handlers.ProjectNoteUpdatePayload": {
            "type": "object",
            "properties": {
                "content": {
                    "type": "string",
                    "example": "Discussed homepage layout and colour palette."
                },
                "description": {
                    "type": "string",
                    "example": "Notes from the 15 Jan kickoff meeting."
                },
                "title": {
                    "type": "string",
                    "example": "Meeting Notes"
                }
            }
        },
        "handlers.ProjectPhaseGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ProjectPhaseResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectPhaseListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectPhaseResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectPhaseResponse": {
            "type": "object",
            "properties": {
                "actualInLabour": {
                    "description": "ActualInLabour is the actual input labour amount = inLabourPrice * timeSpent/60",
                    "type": "number"
                },
                "actualInTotal": {
                    "description": "ActualInTotal is the actual input/cost total = actualInLabour + outUnitTotal",
                    "type": "number"
                },
                "actualInTotalTax": {
                    "type": "number"
                },
                "actualOutLabour": {
                    "description": "ActualOutLabour is the actual output labour amount = outLabourPrice * timeSpent/60",
                    "type": "number"
                },
                "actualProfit": {
                    "description": "ActualProfit = projectedBillAmount - actualInTotal = (actualOutLabour + outUnitTotal) - (actualInLabour + outUnitTotal)",
                    "type": "number"
                },
                "billAmount": {
                    "description": "BillAmount is calculated based on BillType config",
                    "type": "number"
                },
                "billAmountTax": {
                    "description": "BillAmountTax is the tax on BillAmount, calculated based on BillType config",
                    "type": "number"
                },
                "billType": {
                    "description": "BillType determines how billAmount is calculated:\n0 = no bill amount, 1 = item rates and quantities, 2 = fixed fee, 3 = unit prices,\n4 = item rates, 5 = hours spent and quantities, 8 = hours spent",
                    "type": "integer"
                },
                "budget": {
                    "description": "Budget is calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetTax": {
                    "description": "BudgetTax is the tax on Budget, calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetType": {
                    "description": "BudgetType determines how budget is calculated: 0 = no budget, 1 = item totals, 3 = unit prices, 4 = item rates",
                    "type": "integer"
                },
                "datecreated": {
                    "type": "string",
                    "example": "2024-01-10T09:00:00"
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "discount": {
                    "type": "number"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15T00:00:00"
                },
                "estBillAmount": {
                    "description": "EstBillAmount represents billAmount without using actual values (always estimated)",
                    "type": "number"
                },
                "estBillAmountTax": {
                    "description": "EstBillAmountTax is the tax on estBillAmount",
                    "type": "number"
                },
                "estGrossMargin": {
                    "description": "EstGrossMargin = estProfit / estBillAmount % (to nearest whole number)",
                    "type": "number"
                },
                "estInLabour": {
                    "description": "EstInLabour is the estimated input labour amount ($); sum of estInLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estInTotal": {
                    "description": "EstInTotal is the estimated input/cost total = estInLabour + outUnitTotal",
                    "type": "number"
                },
                "estInTotalTax": {
                    "type": "number"
                },
                "estOutLabour": {
                    "description": "EstOutLabour is the estimated output labour amount ($); sum of estOutLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estProfit": {
                    "description": "EstProfit = estBillAmount - estInTotal = (estOutLabour + outUnitTotal) - (estInLabour + outUnitTotal)",
                    "type": "number"
                },
                "id": {
                    "description": "Core identity",
                    "type": "integer",
                    "example": 1
                },
                "inUnitTotal": {
                    "description": "InUnitTotal is the input unit line total = inUnitPrice * inUnitQty",
                    "type": "number"
                },
                "invoicedAmount": {
                    "description": "InvoicedAmount is the dollar value that has been invoiced (may span multiple invoices)",
                    "type": "number"
                },
                "invoicedAmountTax": {
                    "description": "InvoicedAmountTax is the tax amount that has been invoiced (may span multiple invoices)",
                    "type": "number"
                },
                "invoiceitemcollectionid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "itemsActive": {
                    "type": "integer",
                    "example": 2
                },
                "itemsCompleted": {
                    "type": "integer",
                    "example": 3
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "description": "Basic info",
                    "type": "string",
                    "example": "Design Phase"
                },
                "outUnitTotal": {
                    "description": "OutUnitTotal is the output unit line total = outUnitPrice * outUnitQty",
                    "type": "number"
                },
                "paidAmount": {
                    "description": "PaidAmount is the dollar value in invoices marked as paid (may span multiple invoices)",
                    "type": "number"
                },
                "paidAmountTax": {
                    "description": "PaidAmountTax is the tax amount that has been paid (may span multiple invoices)",
                    "type": "number"
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "projectedBillAmount": {
                    "description": "ProjectedBillAmount represents billAmount adjusted for projectedOutTotal values",
                    "type": "number"
                },
                "projectedBillAmountTax": {
                    "description": "ProjectedBillAmountTax is the tax on projectedBillAmount",
                    "type": "number"
                },
                "projectedGrossMargin": {
                    "description": "ProjectedGrossMargin = projectedProfit / projectedOutTotal % (to nearest whole number)",
                    "type": "number"
                },
                "projectedProfit": {
                    "description": "ProjectedProfit = estBillAmount - projectedInTotal (difference between expected total revenue and projected costs)",
                    "type": "number"
                },
                "projectedTimeManual": {
                    "description": "ProjectedTimeManual is the projected total time expected to take to complete the phase",
                    "type": "number"
                },
                "projectedTimeSpent": {
                    "type": "number"
                },
                "projectid": {
                    "description": "Relationships",
                    "type": "integer",
                    "example": 10
                },
                "quoteitemcollectionid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15T00:00:00"
                },
                "storyPoints": {
                    "description": "Progress (non-sensitive)",
                    "type": "number",
                    "example": 13
                },
                "timeBillable": {
                    "description": "Sensitive financial fields — pointer types required for NilSensitiveFields",
                    "type": "number"
                },
                "timeallocated": {
                    "type": "number"
                },
                "timespent": {
                    "type": "number"
                }
            }
        },
        "handlers.ProjectProjectNoteItem": {
            "type": "object",
            "properties": {
                "content": {
                    "type": "string",
                    "example": "Discussed homepage layout and colour palette."
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "title": {
                    "type": "string",
                    "example": "Meeting Notes"
                }
            }
        },
        "handlers.ProjectResponse": {
            "type": "object",
            "properties": {
                "activeworkstate": {
                    "type": "string",
                    "example": "active"
                },
                "actualInLabour": {
                    "description": "actual (sensitive)\nActualInLabour is the actual input labour amount = inLabourPrice * timeSpent/60",
                    "type": "number"
                },
                "actualInTotal": {
                    "description": "ActualInTotal is the actual input/cost total = actualInLabour + outUnitTotal",
                    "type": "number"
                },
                "actualInTotalTax": {
                    "type": "number"
                },
                "actualOutLabour": {
                    "description": "ActualOutLabour is the actual output labour amount = outLabourPrice * timeSpent/60",
                    "type": "number"
                },
                "billAmount": {
                    "description": "BillAmount is calculated based on BillType config",
                    "type": "number"
                },
                "billAmountTax": {
                    "description": "BillAmountTax is the tax on BillAmount, calculated based on BillType config",
                    "type": "number"
                },
                "billType": {
                    "description": "billing detail (sensitive)\nBillType determines how billAmount is calculated:\n0 = no bill amount, 1 = item totals, 2 = fixed fee, 3 = unit prices,\n4 = item labour values, 5 = time spent, 6 = fixed amount per phase,\n7 = fixed amount per project, 8 = item labour values (tracked time only)",
                    "type": "integer"
                },
                "billtotal": {
                    "type": "number",
                    "example": 8000
                },
                "bookmarks": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectBookmarkItem"
                    }
                },
                "budget": {
                    "description": "financial (composite summary fields)",
                    "type": "number",
                    "example": 10000
                },
                "budgetTax": {
                    "description": "BudgetTax is the tax on Budget, calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetType": {
                    "description": "budget detail (sensitive)\nBudgetType determines how budget is calculated: 0 = no budget, 1 = item totals",
                    "type": "integer"
                },
                "burn": {
                    "type": "number",
                    "example": 5000
                },
                "categoryid": {
                    "description": "category",
                    "type": "integer",
                    "example": 1
                },
                "categoryname": {
                    "type": "string",
                    "example": "Web Projects"
                },
                "chargeRateType": {
                    "description": "ChargeRateType determines the default chargeRateType for new items:\n1 = Single Rate, 2 = Split Rate",
                    "type": "integer"
                },
                "clientaccess": {
                    "description": "access/UI settings",
                    "type": "boolean"
                },
                "clientid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "clients": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectContactItem"
                    }
                },
                "clienttype": {
                    "description": "IsClassic       *bool   `json:\"isclassic,omitempty\"`",
                    "type": "string",
                    "example": "external"
                },
                "clientviewalltasks": {
                    "type": "boolean"
                },
                "clientviewtime": {
                    "type": "boolean"
                },
                "companyid": {
                    "description": "company",
                    "type": "integer",
                    "example": 5
                },
                "companyname": {
                    "type": "string",
                    "example": "Acme Corp"
                },
                "completedate": {
                    "type": "string",
                    "example": "2024-04-01"
                },
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "contractorid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "contractors": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectContactItem"
                    }
                },
                "costRateType": {
                    "description": "CostRateType determines the default costRateType for new items:\n0 = No Cost Tracking, 1 = Staff Cost Rate, 2 = Hourly Service Cost Rate",
                    "type": "integer"
                },
                "createdate": {
                    "type": "string",
                    "example": "2024-01-10"
                },
                "customfieldoptionid": {
                    "description": "ICalContactIDs       *models.IntArray          `json:\"icalcontactid,omitempty\"`\nIntegrationFolderIDs *models.IntArray          `json:\"integrationfolderid,omitempty\"`",
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "customfields": {
                    "description": "customfields — typed array of {id, name, type, value, valuename}",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectCustomFieldItem"
                    }
                },
                "deleted": {
                    "description": "metadata",
                    "type": "boolean"
                },
                "description": {
                    "description": "description",
                    "type": "string",
                    "example": "Complete website redesign project"
                },
                "divisionid": {
                    "description": "divisionid",
                    "type": "integer"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-03-15"
                },
                "estBillAmount": {
                    "description": "EstBillAmount represents billAmount without using actual values (always estimated)",
                    "type": "number"
                },
                "estBillAmountTax": {
                    "description": "EstBillAmountTax is the tax on estBillAmount",
                    "type": "number"
                },
                "estGrossMargin": {
                    "description": "EstGrossMargin = estProfit / estBillAmount % (to nearest whole number)",
                    "type": "number"
                },
                "estInLabour": {
                    "description": "estimated (sensitive)\nEstInLabour is the estimated input labour amount ($); sum of estInLabour for all non-deleted items",
                    "type": "number"
                },
                "estInTotal": {
                    "description": "EstInTotal is the estimated input/cost total = estInLabour + outUnitTotal",
                    "type": "number"
                },
                "estInTotalTax": {
                    "type": "number"
                },
                "estOutLabour": {
                    "description": "EstOutLabour is the estimated output labour amount ($); sum of estOutLabour for all non-deleted items",
                    "type": "number"
                },
                "estProfit": {
                    "description": "profit (sensitive)\nEstProfit = estBillAmount - estInTotal = (estOutLabour + outUnitTotal) - (estInLabour + outUnitTotal)",
                    "type": "number"
                },
                "files": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectFileItem"
                    }
                },
                "folders": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectFolderItem"
                    }
                },
                "groupid": {
                    "description": "group (Advanced plan)",
                    "type": "integer",
                    "example": 1
                },
                "groupname": {
                    "type": "string",
                    "example": "Creative Group"
                },
                "id": {
                    "description": "Always present",
                    "type": "integer",
                    "example": 1
                },
                "inUnitTotal": {
                    "description": "units (sensitive)\nInUnitTotal is the input unit line total = inUnitPrice * inUnitQty",
                    "type": "number"
                },
                "internalclientcontactid": {
                    "type": "integer",
                    "example": 10
                },
                "internalclientgroupid": {
                    "type": "integer",
                    "example": 3
                },
                "internalclientgroupname": {
                    "type": "string",
                    "example": "Creative Group"
                },
                "internalclientteamid": {
                    "type": "integer",
                    "example": 2
                },
                "internalclientteamname": {
                    "type": "string",
                    "example": "Design Team"
                },
                "invoiced": {
                    "description": "invoiced/paid status flags",
                    "type": "boolean"
                },
                "invoicedAmount": {
                    "description": "invoiced detail (sensitive)\nInvoicedAmount is the dollar value that has been invoiced (may span multiple invoices)",
                    "type": "number"
                },
                "invoicedAmountTax": {
                    "description": "InvoicedAmountTax is the tax amount that has been invoiced (may span multiple invoices)",
                    "type": "number"
                },
                "invoices": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectInvoiceItem"
                    }
                },
                "invoicetotal": {
                    "type": "number",
                    "example": 7500
                },
                "itemDueDate": {
                    "type": "string",
                    "example": "2024-03-15"
                },
                "itemStartDate": {
                    "type": "string",
                    "example": "2024-01-15"
                },
                "itemsActive": {
                    "type": "integer"
                },
                "itemsCompleted": {
                    "type": "integer"
                },
                "itemsDiscount": {
                    "description": "discount (sensitive)",
                    "type": "number"
                },
                "lastmodifiedutc": {
                    "description": "lastmodified",
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "managerfirstname": {
                    "type": "string",
                    "example": "John"
                },
                "managerid": {
                    "description": "manager",
                    "type": "integer",
                    "example": 1
                },
                "managerlastname": {
                    "type": "string",
                    "example": "Smith"
                },
                "messages": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectMessageItem"
                    }
                },
                "notification": {
                    "type": "boolean"
                },
                "number": {
                    "description": "number",
                    "type": "string",
                    "example": "PRJ-001"
                },
                "outUnitTotal": {
                    "description": "OutUnitTotal is the output unit line total = outUnitPrice * outUnitQty",
                    "type": "number"
                },
                "paid": {
                    "type": "boolean"
                },
                "paidAmountTax": {
                    "description": "PaidAmountTax is the tax amount that has been paid (may span multiple invoices)",
                    "type": "number"
                },
                "paidamount": {
                    "type": "number",
                    "example": 3000
                },
                "percentcomplete": {
                    "description": "percentcomplete (0–100, heading tasks excluded)",
                    "type": "integer",
                    "example": 75
                },
                "phases": {
                    "description": "sub-entity arrays — only present when the corresponding include param is set.\nMust be pointer types so omitempty can distinguish nil (not requested, column absent\nfrom SQL) from a non-nil empty slice (requested but no data → emits []).\nThe typed-row scanner allocates the pointer before calling Scan, so any column that\nis present in the result set always yields a non-nil pointer even when SQL returns NULL.",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectSubPhaseItem"
                    }
                },
                "priority": {
                    "description": "priority (1=Very High … 5=Very Low)",
                    "type": "integer",
                    "example": 2
                },
                "privatenotes": {
                    "description": "privatenotes",
                    "type": "string",
                    "example": "Internal notes"
                },
                "projectedBillAmount": {
                    "description": "projected (billing)\nProjectedBillAmount represents billAmount adjusted for projectedOutTotal values",
                    "type": "number"
                },
                "projectedBillAmountTax": {
                    "description": "ProjectedBillAmountTax is the tax on projectedBillAmount",
                    "type": "number"
                },
                "projectedGrossMargin": {
                    "description": "ProjectedGrossMargin = projectedProfit / projectedOutTotal % (to nearest whole number)",
                    "type": "number"
                },
                "projectedProfit": {
                    "description": "ProjectedProfit = estBillAmount - projectedInTotal (difference between expected total revenue and projected costs)",
                    "type": "number"
                },
                "projectedTimeManual": {
                    "description": "projected (sensitive)\nProjectedTimeManual is the projected total time expected to complete the project",
                    "type": "number"
                },
                "projectedTimeSpent": {
                    "description": "ProjectedTimeSpent is the projected time spent",
                    "type": "number"
                },
                "projectnotes": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectProjectNoteItem"
                    }
                },
                "purchaseorder": {
                    "type": "string",
                    "example": "PO-12345"
                },
                "staff": {
                    "description": "contacts — typed arrays of {id, name, firstname, lastname, type}",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectContactItem"
                    }
                },
                "staffid": {
                    "description": "contact CSV lists",
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "staffviewalltasks": {
                    "type": "boolean"
                },
                "startdate": {
                    "description": "dates",
                    "type": "string",
                    "example": "2024-01-15"
                },
                "storyPoints": {
                    "description": "scoring/aggregates",
                    "type": "number"
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "tags": {
                    "description": "tags — typed array of {id, name, color}",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectTagItem"
                    }
                },
                "teamid": {
                    "description": "team (Advanced plan)",
                    "type": "integer",
                    "example": 1
                },
                "teamname": {
                    "type": "string",
                    "example": "Dev Team"
                },
                "template": {
                    "type": "boolean"
                },
                "timeBillable": {
                    "description": "TimeBillable is the aggregate sum of ItemAllocation.timeBillable",
                    "type": "number"
                },
                "timeallocated": {
                    "description": "time (decimal hours)",
                    "type": "number",
                    "example": 40.5
                },
                "timerecords": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectTimeRecordItem"
                    }
                },
                "timetracked": {
                    "type": "number",
                    "example": 35.25
                },
                "title": {
                    "description": "title",
                    "type": "string",
                    "example": "Website Redesign"
                },
                "workstageid": {
                    "description": "workstage",
                    "type": "integer",
                    "example": 1
                },
                "workstagename": {
                    "type": "string",
                    "example": "Design Phase"
                },
                "workstages": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectWorkStageItem"
                    }
                }
            }
        },
        "handlers.ProjectSettingsDetailResponse": {
            "type": "object",
            "properties": {
                "clientaccess": {
                    "type": "boolean",
                    "example": true
                },
                "clientviewalltasks": {
                    "type": "boolean",
                    "example": false
                },
                "clientviewtime": {
                    "type": "boolean",
                    "example": false
                },
                "middlecontainerorder": {
                    "type": "string",
                    "example": "tasks,phases"
                },
                "notification": {
                    "type": "boolean",
                    "example": true
                },
                "rightcontainerorder": {
                    "type": "string",
                    "example": "messages,files"
                },
                "staffviewalltasks": {
                    "type": "boolean",
                    "example": true
                }
            }
        },
        "handlers.ProjectSettingsGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ProjectSettingsDetailResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectSubItemItem": {
            "type": "object",
            "properties": {
                "activeworkstate": {
                    "type": "string",
                    "example": "active"
                },
                "billable": {
                    "type": "boolean",
                    "example": true
                },
                "code": {
                    "type": "string",
                    "example": "TASK-001"
                },
                "completedate": {
                    "type": "string",
                    "example": ""
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Design homepage"
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "priorityid": {
                    "type": "integer",
                    "example": 3
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15"
                },
                "timeallocated": {
                    "type": "integer",
                    "example": 8
                },
                "timespent": {
                    "type": "integer",
                    "example": 3
                }
            }
        },
        "handlers.ProjectSubPhaseItem": {
            "type": "object",
            "properties": {
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectSubItemItem"
                    }
                },
                "name": {
                    "type": "string",
                    "example": "Design Phase"
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15"
                }
            }
        },
        "handlers.ProjectTagGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ProjectTagResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectTagItem": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "#FF0000"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "VIP"
                }
            }
        },
        "handlers.ProjectTagListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectTagResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectTagResponse": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "id": {
                    "type": "integer"
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "type": "string",
                    "example": "Urgent"
                }
            }
        },
        "handlers.ProjectTemplateListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectTemplateResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectTemplateResponse": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "title": {
                    "type": "string",
                    "example": "Website Redesign Template"
                }
            }
        },
        "handlers.ProjectTimeRecordItem": {
            "type": "object",
            "properties": {
                "accountedfor": {
                    "type": "boolean",
                    "example": true
                },
                "contactid": {
                    "type": "integer",
                    "example": 1
                },
                "endtime": {
                    "type": "string",
                    "example": "17:00"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "itemid": {
                    "type": "integer",
                    "example": 1
                },
                "notes": {
                    "type": "string",
                    "example": "Working on homepage design"
                },
                "running": {
                    "type": "boolean",
                    "example": false
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15"
                },
                "starttime": {
                    "type": "string",
                    "example": "09:00"
                },
                "timespent": {
                    "type": "number",
                    "example": 8
                }
            }
        },
        "handlers.ProjectWorkStageHistoryListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectWorkStageHistoryResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ProjectWorkStageHistoryResponse": {
            "type": "object",
            "properties": {
                "active": {
                    "type": "boolean",
                    "example": true
                },
                "contactid": {
                    "type": "integer",
                    "example": 10
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "In Progress"
                },
                "projectid": {
                    "type": "integer",
                    "example": 15
                },
                "setdatetime": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "workstageid": {
                    "type": "integer",
                    "example": 3
                }
            }
        },
        "handlers.ProjectWorkStageItem": {
            "type": "object",
            "properties": {
                "active": {
                    "type": "boolean",
                    "example": true
                },
                "contactid": {
                    "type": "integer",
                    "example": 10
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "In Progress"
                },
                "projectid": {
                    "type": "integer",
                    "example": 15
                },
                "setdatetime": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "workstageid": {
                    "type": "integer",
                    "example": 3
                }
            }
        },
        "handlers.ProjectnoteGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.ProjectNoteResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.QuoteGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.QuoteResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.QuoteItemGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.QuoteItemResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.QuoteItemListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.QuoteItemResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.QuoteItemResponse": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "description": "Status \u0026 scheduling",
                    "type": "integer"
                },
                "activeworkstate": {
                    "type": "string"
                },
                "billAmount": {
                    "description": "BillAmount is calculated based on BillType config",
                    "type": "number"
                },
                "billAmountTax": {
                    "description": "BillAmountTax is the tax on BillAmount, calculated based on BillType config",
                    "type": "number"
                },
                "billType": {
                    "description": "BillType determines how billAmount is calculated:\n0 = no bill amount, 1 = item rates and quantities, 2 = fixed fee, 3 = unit prices,\n4 = item rates, 5 = hours spent and quantities, 8 = hours spent",
                    "type": "integer"
                },
                "billable": {
                    "type": "boolean"
                },
                "budget": {
                    "description": "Budget is calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetTax": {
                    "description": "BudgetTax is the tax on Budget, calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetType": {
                    "description": "BudgetType determines how budget is calculated: 0 = no budget, 1 = item totals, 3 = unit prices, 4 = item rates",
                    "type": "integer"
                },
                "categoryid": {
                    "type": "integer"
                },
                "chargeRateType": {
                    "description": "ChargeRateType determines how output costs are calculated:\n1 (Single Rate) = use outLabourPrice; 2 (Split Rate) = use outLabourPrice of linked hourly rate services; 0 = no charge rate tracking",
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "completedate": {
                    "type": "string"
                },
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "costRateType": {
                    "description": "CostRateType determines how input costs are calculated:\n1 (Staff Rate) = use rate of linked staff members; 2 (Service Rate) = use rate of linked hourly rate services; 0 = no cost rate tracking",
                    "type": "string"
                },
                "createdatetime": {
                    "type": "string"
                },
                "creatorid": {
                    "type": "integer"
                },
                "deleted": {
                    "type": "boolean"
                },
                "discount": {
                    "type": "number"
                },
                "discountRate": {
                    "type": "number"
                },
                "duedate": {
                    "type": "string"
                },
                "effortScoreId": {
                    "type": "integer"
                },
                "estGrossMargin": {
                    "description": "EstGrossMargin = estProfit / estBillAmount % (to nearest whole number)",
                    "type": "number"
                },
                "estInLabour": {
                    "description": "EstInLabour is the estimated input labour amount ($); sum of estInLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estInTotal": {
                    "description": "EstInTotal is the estimated input/cost total = estInLabour + outUnitTotal",
                    "type": "number"
                },
                "estInTotalTax": {
                    "type": "number"
                },
                "estOutLabour": {
                    "description": "EstOutLabour is the estimated output labour amount ($); sum of estOutLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estProfit": {
                    "description": "EstProfit = estBillAmount - estInTotal = (estOutLabour + outUnitTotal) - (estInLabour + outUnitTotal)",
                    "type": "number"
                },
                "hourlyrateserviceid": {
                    "type": "integer"
                },
                "id": {
                    "description": "Core identity",
                    "type": "integer"
                },
                "impactScoreId": {
                    "type": "integer"
                },
                "importanceScoreId": {
                    "type": "integer"
                },
                "inAccountingCodeId": {
                    "type": "integer"
                },
                "inLabourPrice": {
                    "description": "InLabourPrice is the internal (cost) price of labour for this item",
                    "type": "number"
                },
                "inTaxCodeId": {
                    "description": "Tax \u0026 accounting",
                    "type": "integer"
                },
                "inTaxRate": {
                    "type": "number"
                },
                "inUnitId": {
                    "description": "Units",
                    "type": "integer"
                },
                "inUnitPrice": {
                    "description": "Sensitive financial fields — pointer types required for NilSensitiveFields",
                    "type": "number"
                },
                "inUnitQty": {
                    "type": "number"
                },
                "inUnitTotal": {
                    "description": "InUnitTotal is the input unit line total = inUnitPrice * inUnitQty",
                    "type": "number"
                },
                "isDiscountPercent": {
                    "type": "boolean"
                },
                "itemcollectionid": {
                    "type": "integer"
                },
                "itemtypeid": {
                    "type": "integer"
                },
                "lastmodifiedutc": {
                    "type": "string"
                },
                "manualBillAmount": {
                    "type": "number"
                },
                "manualBudget": {
                    "type": "number"
                },
                "name": {
                    "description": "Basic info",
                    "type": "string"
                },
                "outAccountingCodeId": {
                    "type": "integer"
                },
                "outLabourPrice": {
                    "description": "OutLabourPrice is the sale price for labour",
                    "type": "number"
                },
                "outLabourPriceMultiplier": {
                    "type": "number"
                },
                "outTaxCodeId": {
                    "type": "integer"
                },
                "outTaxRate": {
                    "type": "number"
                },
                "outUnitId": {
                    "type": "integer"
                },
                "outUnitPrice": {
                    "type": "number"
                },
                "outUnitPriceMultiplier": {
                    "type": "number"
                },
                "outUnitQty": {
                    "type": "number"
                },
                "outUnitTotal": {
                    "description": "OutUnitTotal is the output unit line total = outUnitPrice * outUnitQty",
                    "type": "number"
                },
                "parentid": {
                    "type": "integer"
                },
                "priorityid": {
                    "type": "integer"
                },
                "productid": {
                    "type": "integer"
                },
                "projectedProfit": {
                    "description": "ProjectedProfit = estBillAmount - projectedInTotal (difference between expected total revenue and projected costs)",
                    "type": "number"
                },
                "quoteid": {
                    "description": "Relationships",
                    "type": "integer"
                },
                "startdate": {
                    "type": "string"
                },
                "storyPoints": {
                    "description": "Scoring",
                    "type": "number"
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "timeBillable": {
                    "type": "number"
                },
                "timeallocated": {
                    "description": "Time",
                    "type": "number"
                },
                "timespent": {
                    "type": "number"
                },
                "trackingOptionId": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "uniquetoken": {
                    "type": "string"
                },
                "updatedAt": {
                    "type": "number"
                },
                "urgencyScoreId": {
                    "type": "integer"
                }
            }
        },
        "handlers.QuoteListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.QuoteResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.QuotePhaseGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.QuotePhaseResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.QuotePhaseListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.QuotePhaseResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.QuotePhaseResponse": {
            "type": "object",
            "properties": {
                "billAmount": {
                    "description": "BillAmount is calculated based on BillType config",
                    "type": "number"
                },
                "billAmountTax": {
                    "description": "BillAmountTax is the tax on BillAmount, calculated based on BillType config",
                    "type": "number"
                },
                "billType": {
                    "description": "BillType determines how billAmount is calculated:\n0 = no bill amount, 1 = item rates and quantities, 2 = fixed fee, 3 = unit prices,\n4 = item rates, 5 = hours spent and quantities, 8 = hours spent",
                    "type": "integer"
                },
                "budget": {
                    "description": "Budget is calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetTax": {
                    "description": "BudgetTax is the tax on Budget, calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetType": {
                    "description": "BudgetType determines how budget is calculated: 0 = no budget, 1 = item totals, 3 = unit prices, 4 = item rates",
                    "type": "integer"
                },
                "datecreated": {
                    "type": "string",
                    "example": "2024-01-10T09:00:00"
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "discount": {
                    "type": "number"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15T00:00:00"
                },
                "estGrossMargin": {
                    "description": "EstGrossMargin = estProfit / estBillAmount % (to nearest whole number)",
                    "type": "number"
                },
                "estInLabour": {
                    "description": "EstInLabour is the estimated input labour amount ($); sum of estInLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estInTotal": {
                    "description": "EstInTotal is the estimated input/cost total = estInLabour + outUnitTotal",
                    "type": "number"
                },
                "estInTotalTax": {
                    "type": "number"
                },
                "estOutLabour": {
                    "description": "EstOutLabour is the estimated output labour amount ($); sum of estOutLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estProfit": {
                    "description": "EstProfit = estBillAmount - estInTotal = (estOutLabour + outUnitTotal) - (estInLabour + outUnitTotal)",
                    "type": "number"
                },
                "id": {
                    "description": "Core identity",
                    "type": "integer",
                    "example": 5
                },
                "inUnitTotal": {
                    "description": "InUnitTotal is the input unit line total = inUnitPrice * inUnitQty",
                    "type": "number"
                },
                "itemsActive": {
                    "type": "integer",
                    "example": 2
                },
                "itemsCompleted": {
                    "type": "integer",
                    "example": 3
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "description": "Basic info",
                    "type": "string",
                    "example": "Phase 1"
                },
                "outUnitTotal": {
                    "description": "OutUnitTotal is the output unit line total = outUnitPrice * outUnitQty",
                    "type": "number"
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "projectedInLabour": {
                    "type": "number"
                },
                "projectedInTotal": {
                    "type": "number"
                },
                "projectedProfit": {
                    "description": "ProjectedProfit = estBillAmount - projectedInTotal (difference between expected total revenue and projected costs)",
                    "type": "number"
                },
                "quoteid": {
                    "description": "Relationships",
                    "type": "integer",
                    "example": 20
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15T00:00:00"
                },
                "storyPoints": {
                    "description": "Progress (non-sensitive)",
                    "type": "number",
                    "example": 13
                },
                "timeBillable": {
                    "description": "Sensitive financial fields — pointer types required for NilSensitiveFields",
                    "type": "number"
                },
                "timeallocated": {
                    "type": "number"
                }
            }
        },
        "handlers.QuoteResponse": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 1
                },
                "activeworkstate": {
                    "description": "Status",
                    "type": "string",
                    "example": "pending"
                },
                "address1": {
                    "description": "Address",
                    "type": "string",
                    "example": "123 Main Street"
                },
                "address2": {
                    "type": "string",
                    "example": "Suite 100"
                },
                "address3": {
                    "type": "string"
                },
                "approveddate": {
                    "type": "string",
                    "example": "2024-01-20T00:00:00"
                },
                "billAmount": {
                    "description": "Bill detail (sensitive; field group \"billamount\")",
                    "type": "number",
                    "example": 5000
                },
                "billAmountTax": {
                    "description": "BillAmountTax is the tax on BillAmount, calculated based on BillType config",
                    "type": "number",
                    "example": 5750
                },
                "billType": {
                    "description": "BillType determines how billAmount is calculated:\n0 = no bill amount, 1 = item totals, 2 = fixed fee, 3 = unit prices,\n4 = item labour values, 5 = time spent, 6 = fixed amount per phase,\n7 = fixed amount per project, 8 = item labour values (tracked time only)",
                    "type": "integer",
                    "example": 1
                },
                "budget": {
                    "description": "Budget detail (sensitive; field group \"budget\")",
                    "type": "number",
                    "example": 5000
                },
                "budgetTax": {
                    "description": "BudgetTax is the tax on Budget, calculated based on BudgetType config",
                    "type": "number",
                    "example": 5750
                },
                "budgetType": {
                    "description": "BudgetType determines how budget is calculated: 0 = no budget, 1 = item totals",
                    "type": "integer",
                    "example": 1
                },
                "city": {
                    "type": "string",
                    "example": "New York"
                },
                "clientcontactname": {
                    "description": "Client contact",
                    "type": "string",
                    "example": "John Doe"
                },
                "companyid": {
                    "description": "Company",
                    "type": "integer",
                    "example": 5
                },
                "companyname": {
                    "type": "string",
                    "example": "Acme Corp"
                },
                "country": {
                    "type": "string",
                    "example": "United States"
                },
                "customfieldname": {
                    "description": "Custom field (requires QuoteDetails JOIN)",
                    "type": "string",
                    "example": "Reference"
                },
                "customfieldvalue": {
                    "type": "string",
                    "example": "REF-001"
                },
                "description": {
                    "type": "string",
                    "example": "Quote for website design services"
                },
                "emaileddate": {
                    "type": "string",
                    "example": "2024-01-15T13:20:00"
                },
                "emailedto": {
                    "type": "string",
                    "example": "client@example.com"
                },
                "emailedtoclient": {
                    "description": "Flags",
                    "type": "boolean",
                    "example": true
                },
                "grandtotal": {
                    "type": "number",
                    "example": 5750
                },
                "id": {
                    "type": "integer",
                    "example": 20
                },
                "lastmodifiedutc": {
                    "description": "Audit",
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "number": {
                    "description": "Core",
                    "type": "string",
                    "example": "QT-001"
                },
                "pagetitle": {
                    "description": "Display",
                    "type": "string",
                    "example": "Quote"
                },
                "phases": {
                    "description": "Sub-entities — populated only when IncludePhases=true (via OUTER APPLY in main query).\nUse fields=phases or fields=all,phases to include. Never triggered by \"all\" alone.",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.QuoteSubPhaseItem"
                    }
                },
                "projectid": {
                    "description": "Project",
                    "type": "integer",
                    "example": 15
                },
                "quotedate": {
                    "description": "Dates",
                    "type": "string",
                    "example": "2024-01-15T00:00:00"
                },
                "quotedby": {
                    "description": "Quoted by (contact name)",
                    "type": "string",
                    "example": "Jane Doe"
                },
                "showcostbreakdown": {
                    "type": "boolean",
                    "example": false
                },
                "showitemdescription": {
                    "type": "boolean",
                    "example": true
                },
                "showphases": {
                    "type": "boolean",
                    "example": true
                },
                "state": {
                    "type": "string",
                    "example": "NY"
                },
                "subtotal": {
                    "description": "Financial totals (sensitive; field group \"totals\")",
                    "type": "number",
                    "example": 5000
                },
                "taxable": {
                    "description": "Tax (require Quotes / QuoteDetails JOINs)",
                    "type": "boolean",
                    "example": true
                },
                "taxrate": {
                    "type": "number",
                    "example": 15
                },
                "taxtotal": {
                    "type": "number",
                    "example": 750
                },
                "title": {
                    "type": "string",
                    "example": "Website Project Quote"
                },
                "type": {
                    "description": "Type and description (require Quotes JOIN)",
                    "type": "string",
                    "example": "quote"
                },
                "validdate": {
                    "type": "string",
                    "example": "2024-02-15T00:00:00"
                },
                "zipcode": {
                    "type": "string",
                    "example": "10001"
                }
            }
        },
        "handlers.QuoteSubItemItem": {
            "type": "object",
            "properties": {
                "activeworkstate": {
                    "type": "string",
                    "example": "active"
                },
                "billAmount": {
                    "type": "number",
                    "example": 1000
                },
                "billAmountTax": {
                    "type": "number",
                    "example": 1150
                },
                "billType": {
                    "type": "integer",
                    "example": 1
                },
                "billable": {
                    "type": "boolean",
                    "example": true
                },
                "budget": {
                    "type": "number",
                    "example": 1000
                },
                "budgetTax": {
                    "type": "number",
                    "example": 1150
                },
                "budgetType": {
                    "type": "integer",
                    "example": 1
                },
                "categoryid": {
                    "type": "integer",
                    "example": 3
                },
                "code": {
                    "type": "string",
                    "example": "ITEM-001"
                },
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        10
                    ]
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "discount": {
                    "type": "number",
                    "example": 0
                },
                "estInTotal": {
                    "type": "number",
                    "example": 500
                },
                "estInTotalTax": {
                    "type": "number",
                    "example": 575
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "inUnitTotal": {
                    "type": "number",
                    "example": 500
                },
                "itemcollectionid": {
                    "type": "integer",
                    "example": 5
                },
                "itemtypeid": {
                    "type": "integer",
                    "example": 1
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "type": "string",
                    "example": "Web Design"
                },
                "outUnitTotal": {
                    "type": "number",
                    "example": 1000
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "quoteid": {
                    "type": "integer",
                    "example": 20
                },
                "sortorder": {
                    "type": "string",
                    "example": "0x000001"
                },
                "timeBillable": {
                    "type": "integer",
                    "example": 120
                },
                "timeallocated": {
                    "type": "integer",
                    "example": 120
                },
                "trackingOptionId": {
                    "type": "string",
                    "example": "0"
                }
            }
        },
        "handlers.QuoteSubPhaseItem": {
            "type": "object",
            "properties": {
                "billAmount": {
                    "type": "number",
                    "example": 5000
                },
                "billAmountTax": {
                    "type": "number",
                    "example": 5750
                },
                "billType": {
                    "type": "integer",
                    "example": 1
                },
                "budget": {
                    "type": "number",
                    "example": 5000
                },
                "budgetTax": {
                    "type": "number",
                    "example": 5750
                },
                "budgetType": {
                    "type": "integer",
                    "example": 1
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "discount": {
                    "type": "number",
                    "example": 0
                },
                "estGrossMargin": {
                    "type": "number",
                    "example": 60
                },
                "estInLabour": {
                    "type": "number",
                    "example": 2000
                },
                "estInTotal": {
                    "type": "number",
                    "example": 2000
                },
                "estInTotalTax": {
                    "type": "number",
                    "example": 2300
                },
                "estOutLabour": {
                    "type": "number",
                    "example": 5000
                },
                "estProfit": {
                    "type": "number",
                    "example": 3000
                },
                "id": {
                    "type": "integer",
                    "example": 5
                },
                "inUnitTotal": {
                    "type": "number",
                    "example": 2000
                },
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.QuoteSubItemItem"
                    }
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "type": "string",
                    "example": "Phase 1"
                },
                "outUnitTotal": {
                    "type": "number",
                    "example": 5000
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "projectedInLabour": {
                    "type": "number",
                    "example": 2000
                },
                "projectedInTotal": {
                    "type": "number",
                    "example": 2000
                },
                "projectedProfit": {
                    "type": "number",
                    "example": 3000
                },
                "quoteid": {
                    "type": "integer",
                    "example": 20
                },
                "sortorder": {
                    "type": "string",
                    "example": "0x000001"
                },
                "timeBillable": {
                    "type": "integer",
                    "example": 480
                },
                "timeallocated": {
                    "type": "integer",
                    "example": 480
                }
            }
        },
        "handlers.QuoteTemplateListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.QuoteTemplateResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.QuoteTemplateResponse": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "title": {
                    "type": "string",
                    "example": "Website Quote Template"
                }
            }
        },
        "handlers.QuoteWorkStageHistoryListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.QuoteWorkStageHistoryResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.QuoteWorkStageHistoryResponse": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "integer",
                    "example": 10
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Approved"
                },
                "quoteid": {
                    "type": "integer",
                    "example": 20
                },
                "setdatetime": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "workstageid": {
                    "type": "integer",
                    "example": 3
                }
            }
        },
        "handlers.RemoveAllContactsFromItemsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.RemoveAllTagsFromItemsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.RemoveAllTagsFromProjectsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.RemoveContactsFromProjectsPayload": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.RemoveContactsFromRolesPayload": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.RemoveTagsFromCompaniesPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.RemoveTagsFromContactsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.RemoveTagsFromProjectsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.ResthookListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ResthookResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ResthookRequestListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ResthookRequestResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ResthookRequestResponse": {
            "type": "object",
            "properties": {
                "completetime": {
                    "type": "string",
                    "example": "2024-01-18T13:20:01"
                },
                "dataid": {
                    "type": "integer",
                    "example": 100
                },
                "dataurl": {
                    "type": "string",
                    "example": "https://api.example.com/data/100"
                },
                "event": {
                    "type": "string",
                    "example": "project"
                },
                "httpstatuscode": {
                    "type": "integer",
                    "example": 200
                },
                "id": {
                    "type": "integer"
                },
                "nextruntime": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "resthookid": {
                    "type": "integer",
                    "example": 2
                },
                "starttime": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "tries": {
                    "type": "integer",
                    "example": 1
                },
                "url": {
                    "type": "string",
                    "example": "https://example.com/webhook"
                }
            }
        },
        "handlers.ResthookResponse": {
            "type": "object",
            "properties": {
                "event": {
                    "type": "string",
                    "example": "project"
                },
                "id": {
                    "type": "integer"
                },
                "url": {
                    "type": "string",
                    "example": "https://example.com/webhook"
                }
            }
        },
        "handlers.RoleGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.RoleResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.RoleListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.RoleResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.RoleResponse": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "#1A5276"
                },
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Administrator"
                }
            }
        },
        "handlers.RolesToContactsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "roleid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.ServiceRateListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ServiceRateResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.ServiceRateResponse": {
            "type": "object",
            "properties": {
                "billable": {
                    "type": "boolean",
                    "example": true
                },
                "description": {
                    "type": "string",
                    "example": "Standard hourly rate"
                },
                "id": {
                    "type": "integer"
                },
                "inAccountingCodeId": {
                    "type": "integer",
                    "example": 3
                },
                "inTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Standard Rate"
                },
                "outAccountingCodeId": {
                    "type": "integer",
                    "example": 4
                },
                "outTaxCodeId": {
                    "type": "integer",
                    "example": 2
                },
                "sortorder": {
                    "type": "string",
                    "example": "1"
                },
                "taxable": {
                    "type": "boolean",
                    "example": true
                }
            }
        },
        "handlers.SetRolePermissionInput": {
            "type": "object",
            "properties": {
                "add": {
                    "type": "boolean",
                    "example": true
                },
                "delete": {
                    "type": "boolean",
                    "example": false
                },
                "edit": {
                    "type": "boolean",
                    "example": true
                },
                "permissionid": {
                    "type": "integer",
                    "example": 8
                },
                "view": {
                    "type": "boolean",
                    "example": true
                }
            }
        },
        "handlers.SettingsInvoicesAutonumberingListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SettingsInvoicesAutonumberingResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.SettingsInvoicesAutonumberingResponse": {
            "type": "object",
            "properties": {
                "autoinvoicenumber": {
                    "type": "string",
                    "example": "true"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "invoicenumbercount": {
                    "type": "integer",
                    "example": 42
                },
                "invoicenumbermask": {
                    "type": "string",
                    "example": "INV-####"
                },
                "invoicenumberplaceholder": {
                    "type": "string",
                    "example": "####"
                }
            }
        },
        "handlers.SettingsProductFixedpriceListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SettingsProductFixedpriceResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.SettingsProductFixedpriceResponse": {
            "type": "object",
            "properties": {
                "billable": {
                    "type": "boolean",
                    "example": true
                },
                "code": {
                    "type": "string",
                    "example": "WEB-PKG"
                },
                "color": {
                    "type": "string",
                    "example": "#1A5276"
                },
                "divisionid": {
                    "type": "integer",
                    "example": 1
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "inAccountingCodeId": {
                    "type": "integer",
                    "example": 0
                },
                "inTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "inUnitId": {
                    "type": "integer",
                    "example": 1
                },
                "inUnitPrice": {
                    "type": "number",
                    "example": 500
                },
                "itemtypeid": {
                    "type": "integer",
                    "example": 3
                },
                "name": {
                    "type": "string",
                    "example": "Website Package"
                },
                "outAccountingCodeId": {
                    "type": "integer",
                    "example": 0
                },
                "outTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "outUnitId": {
                    "type": "integer",
                    "example": 1
                },
                "outUnitPrice": {
                    "type": "number",
                    "example": 1500
                },
                "purchasedescription": {
                    "type": "string",
                    "example": "Website design and development services"
                },
                "saledescription": {
                    "type": "string",
                    "example": "Complete website design and development"
                }
            }
        },
        "handlers.SettingsProductGoodserviceListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SettingsProductGoodserviceResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.SettingsProductGoodserviceResponse": {
            "type": "object",
            "properties": {
                "billable": {
                    "type": "boolean",
                    "example": true
                },
                "code": {
                    "type": "string",
                    "example": "DESIGN-SVC"
                },
                "color": {
                    "type": "string",
                    "example": "#1A5276"
                },
                "divisionid": {
                    "type": "integer",
                    "example": 1
                },
                "hourlyrateserviceid": {
                    "type": "integer",
                    "example": 3
                },
                "hourlyrateservicename": {
                    "type": "string",
                    "example": "Senior Designer"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "inAccountingCodeId": {
                    "type": "integer",
                    "example": 0
                },
                "inLabourPrice": {
                    "type": "number",
                    "example": 50
                },
                "inTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "inUnitId": {
                    "type": "integer",
                    "example": 1
                },
                "inUnitPrice": {
                    "type": "number",
                    "example": 50
                },
                "itemtypeid": {
                    "type": "integer",
                    "example": 2
                },
                "name": {
                    "type": "string",
                    "example": "Design Service"
                },
                "outAccountingCodeId": {
                    "type": "integer",
                    "example": 0
                },
                "outLabourPrice": {
                    "type": "number",
                    "example": 100
                },
                "outTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "outUnitId": {
                    "type": "integer",
                    "example": 1
                },
                "outUnitPrice": {
                    "type": "number",
                    "example": 100
                },
                "purchasedescription": {
                    "type": "string",
                    "example": "Design work"
                },
                "saledescription": {
                    "type": "string",
                    "example": "Professional design services"
                }
            }
        },
        "handlers.SettingsProductHourlyserviceListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SettingsProductHourlyserviceResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.SettingsProductHourlyserviceResponse": {
            "type": "object",
            "properties": {
                "billable": {
                    "type": "boolean",
                    "example": true
                },
                "code": {
                    "type": "string",
                    "example": "SR-DESIGN"
                },
                "color": {
                    "type": "string",
                    "example": "#1A5276"
                },
                "divisionid": {
                    "type": "integer",
                    "example": 1
                },
                "hourlyrateserviceid": {
                    "type": "integer",
                    "example": 3
                },
                "hourlyrateservicename": {
                    "type": "string",
                    "example": "Senior Designer"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "inAccountingCodeId": {
                    "type": "integer",
                    "example": 0
                },
                "inLabourPrice": {
                    "type": "number",
                    "example": 50
                },
                "inTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "itemtypeid": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Senior Designer"
                },
                "outAccountingCodeId": {
                    "type": "integer",
                    "example": 0
                },
                "outLabourPrice": {
                    "type": "number",
                    "example": 100
                },
                "outTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "purchasedescription": {
                    "type": "string",
                    "example": "Design hours"
                },
                "saledescription": {
                    "type": "string",
                    "example": "Hourly design services"
                }
            }
        },
        "handlers.SettingsProjectsAutonumberingListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SettingsProjectsAutonumberingResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.SettingsProjectsAutonumberingResponse": {
            "type": "object",
            "properties": {
                "autoprojectnumber": {
                    "type": "string",
                    "example": "true"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "projectnumbercount": {
                    "type": "integer",
                    "example": 100
                },
                "projectnumbermask": {
                    "type": "string",
                    "example": "PRJ-####"
                },
                "projectnumberplaceholder": {
                    "type": "string",
                    "example": "####"
                },
                "projectnumbertype": {
                    "type": "string",
                    "example": "sequential"
                }
            }
        },
        "handlers.SettingsProjectsListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SettingsProjectsResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.SettingsProjectsResponse": {
            "type": "object",
            "properties": {
                "autoprojectnumber": {
                    "type": "string",
                    "example": "true"
                },
                "emptyprojectcategory": {
                    "type": "string",
                    "example": "Uncategorized"
                },
                "emptytaskcategory": {
                    "type": "string",
                    "example": "General"
                },
                "enableSubPhases": {
                    "type": "boolean",
                    "example": false
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "projectnumbercount": {
                    "type": "integer",
                    "example": 100
                },
                "projectnumbermask": {
                    "type": "string",
                    "example": "PRJ-####"
                },
                "projectnumberplaceholder": {
                    "type": "string",
                    "example": "####"
                },
                "projectnumbertype": {
                    "type": "string",
                    "example": "sequential"
                },
                "projectvariable": {
                    "type": "string",
                    "example": "Project"
                },
                "taskordering": {
                    "type": "string",
                    "example": "manual"
                }
            }
        },
        "handlers.SettingsQuotesAutonumberingListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SettingsQuotesAutonumberingResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.SettingsQuotesAutonumberingResponse": {
            "type": "object",
            "properties": {
                "autoquotenumber": {
                    "type": "string",
                    "example": "true"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "quotenumbercount": {
                    "type": "integer",
                    "example": 20
                },
                "quotenumbermask": {
                    "type": "string",
                    "example": "QT-####"
                },
                "quotenumberplaceholder": {
                    "type": "string",
                    "example": "####"
                }
            }
        },
        "handlers.SettingsQuotesListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SettingsQuotesResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.SettingsQuotesResponse": {
            "type": "object",
            "properties": {
                "clientemailcontent": {
                    "type": "string",
                    "example": "Please find your quote attached."
                },
                "clientemailfromaddress": {
                    "type": "string",
                    "example": "noreply@example.com"
                },
                "clientemailsubject": {
                    "type": "string",
                    "example": "Your Quote from ProWorkflow"
                },
                "contactfooter": {
                    "type": "string",
                    "example": "Thank you for your business"
                },
                "footerdetails": {
                    "type": "string",
                    "example": "Payment due within 30 days"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "logo": {
                    "type": "string",
                    "example": "https://example.com/img/logo.png"
                },
                "pagetitle": {
                    "type": "string",
                    "example": "Quote"
                },
                "quoteperiod": {
                    "type": "integer",
                    "example": 30
                },
                "quoteterms": {
                    "type": "string",
                    "example": "Valid for 30 days"
                },
                "showItemDescription": {
                    "type": "boolean",
                    "example": true
                },
                "showPhases": {
                    "type": "boolean",
                    "example": true
                },
                "showcostbreakdown": {
                    "type": "boolean",
                    "example": false
                },
                "usequoteterms": {
                    "type": "string",
                    "example": "true"
                }
            }
        },
        "handlers.StaffRateListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.StaffRateResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.StaffRateResponse": {
            "type": "object",
            "properties": {
                "firstname": {
                    "type": "string",
                    "example": "Jane"
                },
                "hourlyrateserviceid": {
                    "type": "integer",
                    "example": 2
                },
                "hourlyrateservicename": {
                    "type": "string",
                    "example": "Standard Rate"
                },
                "id": {
                    "type": "integer"
                },
                "lastname": {
                    "type": "string",
                    "example": "Smith"
                },
                "outprice": {
                    "type": "number",
                    "example": 120
                }
            }
        },
        "handlers.StartTimerRequest": {
            "type": "object",
            "properties": {
                "itemid": {
                    "type": "integer",
                    "example": 2150
                }
            }
        },
        "handlers.StopTimerRequest": {
            "type": "object",
            "properties": {
                "notes": {
                    "type": "string",
                    "example": "Worked on homepage"
                },
                "timespent": {
                    "type": "integer",
                    "example": 60
                }
            }
        },
        "handlers.TagsToCompaniesPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.TagsToContactsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.TagsToItemsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.TagsToProjectsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.TeamGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.TeamResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.TeamListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.TeamResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.TeamResponse": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string",
                    "example": "ENG"
                },
                "groupid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Engineering"
                }
            }
        },
        "handlers.TemplateItemGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.TemplateItemResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.TemplateItemListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.TemplateItemResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.TemplateItemResponse": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 1
                },
                "activeworkstate": {
                    "type": "string",
                    "example": "active"
                },
                "billAmount": {
                    "description": "BillAmount is calculated based on BillType config",
                    "type": "number"
                },
                "billAmountTax": {
                    "description": "BillAmountTax is the tax on BillAmount, calculated based on BillType config",
                    "type": "number"
                },
                "billType": {
                    "description": "BillType determines how billAmount is calculated:\n0 = no bill amount, 1 = item rates and quantities, 2 = fixed fee, 3 = unit prices,\n4 = item rates, 5 = hours spent and quantities, 8 = hours spent",
                    "type": "integer"
                },
                "billable": {
                    "type": "boolean",
                    "example": true
                },
                "budget": {
                    "description": "Budget is calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetTax": {
                    "description": "BudgetTax is the tax on Budget, calculated based on BudgetType config",
                    "type": "number"
                },
                "budgetType": {
                    "description": "BudgetType determines how budget is calculated: 0 = no budget, 1 = item totals, 3 = unit prices, 4 = item rates",
                    "type": "integer"
                },
                "categoryid": {
                    "type": "integer",
                    "example": 3
                },
                "chargeRateType": {
                    "description": "ChargeRateType determines how output costs are calculated:\n1 (Single Rate) = use outLabourPrice; 2 (Split Rate) = use outLabourPrice of linked hourly rate services; 0 = no charge rate tracking",
                    "type": "integer"
                },
                "code": {
                    "type": "string",
                    "example": "TASK-001"
                },
                "completedate": {
                    "type": "string",
                    "example": "2024-01-19T00:00:00"
                },
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "costRateType": {
                    "description": "CostRateType determines how input costs are calculated:\n1 (Staff Rate) = use rate of linked staff members; 2 (Service Rate) = use rate of linked hourly rate services; 0 = no cost rate tracking",
                    "type": "integer"
                },
                "createdatetime": {
                    "type": "string",
                    "example": "2024-01-10T09:00:00"
                },
                "creatorid": {
                    "type": "integer",
                    "example": 10
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "dependenttaskid": {
                    "type": "string",
                    "example": ""
                },
                "discount": {
                    "description": "Discount (sensitive)",
                    "type": "number"
                },
                "discountRate": {
                    "type": "number"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-01-20T00:00:00"
                },
                "effortScoreId": {
                    "type": "integer"
                },
                "estGrossMargin": {
                    "description": "EstGrossMargin = estProfit / estBillAmount % (to nearest whole number)",
                    "type": "number"
                },
                "estInLabour": {
                    "description": "Estimated (sensitive)\nEstInLabour is the estimated input labour amount ($); sum of estInLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estInTotal": {
                    "description": "EstInTotal is the estimated input/cost total = estInLabour + outUnitTotal",
                    "type": "number"
                },
                "estInTotalTax": {
                    "type": "number"
                },
                "estOutLabour": {
                    "description": "EstOutLabour is the estimated output labour amount ($); sum of estOutLabour for all non-deleted timeallocations",
                    "type": "number"
                },
                "estProfit": {
                    "description": "Profit (sensitive)\nEstProfit = estBillAmount - estInTotal = (estOutLabour + outUnitTotal) - (estInLabour + outUnitTotal)",
                    "type": "number"
                },
                "hourlyrateserviceid": {
                    "type": "integer",
                    "example": 0
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "impactScoreId": {
                    "type": "integer"
                },
                "importanceScoreId": {
                    "type": "integer"
                },
                "inAccountingCodeId": {
                    "type": "integer"
                },
                "inLabourPrice": {
                    "description": "InLabourPrice is the internal (cost) price of labour for this item",
                    "type": "number"
                },
                "inTaxCodeId": {
                    "description": "Tax/accounting",
                    "type": "integer"
                },
                "inTaxRate": {
                    "type": "number"
                },
                "inUnitId": {
                    "description": "Units/pricing (sensitive)",
                    "type": "integer"
                },
                "inUnitPrice": {
                    "type": "number"
                },
                "inUnitQty": {
                    "type": "number"
                },
                "inUnitTotal": {
                    "description": "InUnitTotal is the input unit line total = inUnitPrice * inUnitQty",
                    "type": "number"
                },
                "isDiscountPercent": {
                    "type": "boolean"
                },
                "itemcollectionid": {
                    "type": "integer",
                    "example": 5
                },
                "itemcollectiontemplateid": {
                    "type": "integer",
                    "example": 2
                },
                "itemtypeid": {
                    "type": "integer",
                    "example": 1
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "manualBillAmount": {
                    "description": "Billing (sensitive)",
                    "type": "number"
                },
                "manualBudget": {
                    "description": "Budget (sensitive)",
                    "type": "number"
                },
                "name": {
                    "type": "string",
                    "example": "Design homepage"
                },
                "outAccountingCodeId": {
                    "type": "integer"
                },
                "outLabourPrice": {
                    "description": "OutLabourPrice is the sale price for labour",
                    "type": "number"
                },
                "outLabourPriceMultiplier": {
                    "type": "number"
                },
                "outTaxCodeId": {
                    "type": "integer"
                },
                "outTaxRate": {
                    "type": "number"
                },
                "outUnitId": {
                    "type": "integer"
                },
                "outUnitPrice": {
                    "type": "number"
                },
                "outUnitPriceMultiplier": {
                    "type": "number"
                },
                "outUnitQty": {
                    "type": "number"
                },
                "outUnitTotal": {
                    "description": "OutUnitTotal is the output unit line total = outUnitPrice * outUnitQty",
                    "type": "number"
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "prerequisiteid": {
                    "type": "string",
                    "example": ""
                },
                "priorityid": {
                    "type": "integer",
                    "example": 2
                },
                "productid": {
                    "type": "integer",
                    "example": 0
                },
                "projectedProfit": {
                    "description": "ProjectedProfit = estBillAmount - projectedInTotal (difference between expected total revenue and projected costs)",
                    "type": "number"
                },
                "sortorder": {
                    "type": "string",
                    "example": "0x000001"
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15T00:00:00"
                },
                "storyPoints": {
                    "description": "Scoring",
                    "type": "number"
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "timeBillable": {
                    "type": "number",
                    "example": 120
                },
                "timeallocated": {
                    "type": "number",
                    "example": 120
                },
                "timespent": {
                    "type": "number",
                    "example": 60
                },
                "trackingOptionId": {
                    "type": "string"
                },
                "uniquetoken": {
                    "type": "string",
                    "example": "abc123xyz"
                },
                "urgencyScoreId": {
                    "type": "integer"
                }
            }
        },
        "handlers.TemplatePhaseCreatePayload": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "example": "Design Phase"
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "templateid": {
                    "type": "integer",
                    "example": 2
                }
            }
        },
        "handlers.TemplatePhaseGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.TemplatePhaseResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.TemplatePhaseListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.TemplatePhaseResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.TemplatePhaseResponse": {
            "type": "object",
            "properties": {
                "billAmount": {
                    "type": "number"
                },
                "billAmountTax": {
                    "type": "number"
                },
                "billType": {
                    "description": "Billing (sensitive)",
                    "type": "integer"
                },
                "budget": {
                    "type": "number"
                },
                "budgetTax": {
                    "type": "number"
                },
                "budgetType": {
                    "description": "Budget (sensitive)",
                    "type": "integer"
                },
                "datecreated": {
                    "type": "string",
                    "example": "2024-01-10T09:00:00"
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "discount": {
                    "type": "number"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15T00:00:00"
                },
                "estGrossMargin": {
                    "type": "number"
                },
                "estInLabour": {
                    "description": "Estimated (sensitive)",
                    "type": "number"
                },
                "estInTotal": {
                    "type": "number"
                },
                "estInTotalTax": {
                    "type": "number"
                },
                "estOutLabour": {
                    "type": "number"
                },
                "estProfit": {
                    "description": "Profit/margin (sensitive)",
                    "type": "number"
                },
                "id": {
                    "type": "integer",
                    "example": 5
                },
                "inUnitTotal": {
                    "description": "Units",
                    "type": "number"
                },
                "itemcollectiontemplateid": {
                    "type": "integer",
                    "example": 2
                },
                "itemsActive": {
                    "type": "integer",
                    "example": 2
                },
                "itemsCompleted": {
                    "type": "integer",
                    "example": 3
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-18T13:20:00"
                },
                "name": {
                    "type": "string",
                    "example": "Design Phase"
                },
                "outUnitTotal": {
                    "type": "number"
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "projectedProfit": {
                    "type": "number"
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15T00:00:00"
                },
                "storyPoints": {
                    "description": "Aggregated fields",
                    "type": "number",
                    "example": 13
                },
                "timeBillable": {
                    "type": "number"
                },
                "timeallocated": {
                    "type": "number"
                },
                "timespent": {
                    "type": "number"
                }
            }
        },
        "handlers.TemplatePhaseUpdatePayload": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "example": "Design Phase"
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "sortorder": {
                    "type": "integer",
                    "example": 1
                }
            }
        },
        "handlers.TimeAllocationCreatePayload": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "integer",
                    "example": 10
                },
                "hourlyrateserviceid": {
                    "type": "integer",
                    "example": 0
                },
                "itemid": {
                    "type": "integer",
                    "example": 5
                },
                "starttime": {
                    "type": "string",
                    "example": "2024-01-15T09:00:00Z"
                },
                "timeBillable": {
                    "type": "integer",
                    "example": 120
                },
                "timeallocated": {
                    "type": "integer",
                    "example": 120
                }
            }
        },
        "handlers.TimeAllocationDeletePayload": {
            "type": "object",
            "properties": {
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.TimeAllocationGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.TimeAllocationResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.TimeAllocationListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.TimeAllocationResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.TimeAllocationResponse": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "integer",
                    "example": 10
                },
                "estinlabour": {
                    "description": "EstInLabour is the estimated total internal labour cost ($) = inLabourPrice * timeAllocated / 60",
                    "type": "number",
                    "example": 100
                },
                "estoutlabour": {
                    "description": "EstOutLabour is the estimated total sale labour cost ($) = outLabourPrice * timeAllocated / 60",
                    "type": "number",
                    "example": 200
                },
                "hourlyrateserviceid": {
                    "type": "integer",
                    "example": 0
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "inlabourprice": {
                    "description": "InLabourPrice is the internal labour rate ($/hr), calculated based on the linked item's costRateType:\n- costRateType 1 (staff rate): contact.payrate * contact.payRateMultiplier, or division.defaultpayrate * division.payratemultiplier if contact.payrate is null\n- costRateType 2 (service rate): inLabourPrice ?? hourlyrateservice.inLabourPrice\n- otherwise: 0",
                    "type": "number",
                    "example": 50
                },
                "itemid": {
                    "type": "integer",
                    "example": 5
                },
                "outlabourprice": {
                    "description": "OutLabourPrice is the sale labour rate ($/hr), calculated based on the linked item's chargeRateType:\n- chargeRateType 1 (single rate): item.outLabourPrice\n- chargeRateType 2 (split rate): outLabourPrice ?? hourlyrateservice.outLabourPrice\n- otherwise: 0",
                    "type": "number",
                    "example": 100
                },
                "projectid": {
                    "type": "integer",
                    "example": 15
                },
                "starttime": {
                    "type": "string",
                    "example": "2024-01-15T09:00:00"
                },
                "timeallocated": {
                    "type": "integer",
                    "example": 120
                },
                "timebillable": {
                    "type": "integer",
                    "example": 120
                }
            }
        },
        "handlers.TimeAllocationUpdatePayload": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "integer"
                },
                "hourlyrateserviceid": {
                    "type": "integer"
                },
                "itemid": {
                    "type": "integer"
                },
                "starttime": {
                    "type": "string"
                },
                "timeBillable": {
                    "type": "integer"
                },
                "timeallocated": {
                    "type": "integer"
                }
            }
        },
        "handlers.TimeCreatePayload": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "integer",
                    "example": 1
                },
                "itemid": {
                    "type": "integer",
                    "example": 73675
                },
                "notes": {
                    "type": "string",
                    "example": "my note"
                },
                "starttime": {
                    "type": "string",
                    "example": "2026-04-21T23:41:44.870Z"
                },
                "timeAllocationId": {
                    "type": "integer",
                    "example": 0
                },
                "timespent": {
                    "type": "integer",
                    "example": 240
                }
            }
        },
        "handlers.TimeGetResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.TimeResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.TimeListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.TimeResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.TimeResponse": {
            "type": "object",
            "properties": {
                "accountedfor": {
                    "type": "boolean",
                    "example": false
                },
                "billable": {
                    "type": "boolean",
                    "example": true
                },
                "companyid": {
                    "type": "integer",
                    "example": 2
                },
                "companyname": {
                    "type": "string",
                    "example": "Acme Corp"
                },
                "contactid": {
                    "type": "integer",
                    "example": 5
                },
                "contactname": {
                    "type": "string",
                    "example": "John Doe"
                },
                "endtime": {
                    "type": "string",
                    "example": "2024-01-15T17:00:00"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "itemcollectionid": {
                    "type": "integer",
                    "example": 5
                },
                "itemid": {
                    "type": "integer",
                    "example": 10
                },
                "itemname": {
                    "type": "string",
                    "example": "Design Homepage"
                },
                "lastmodifiedutc": {
                    "type": "string",
                    "example": "2024-01-15T15:30:00"
                },
                "notes": {
                    "type": "string",
                    "example": "Worked on homepage design"
                },
                "projectid": {
                    "type": "integer",
                    "example": 3
                },
                "projectnumber": {
                    "type": "string",
                    "example": "PRJ-001"
                },
                "projecttitle": {
                    "type": "string",
                    "example": "Website Redesign"
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15"
                },
                "starttime": {
                    "type": "string",
                    "example": "2024-01-15T09:00:00"
                },
                "timeallocationid": {
                    "type": "integer",
                    "example": 1
                },
                "timespent": {
                    "type": "number",
                    "example": 480
                }
            }
        },
        "handlers.TimeUpdatePayload": {
            "type": "object",
            "properties": {
                "itemid": {
                    "type": "integer",
                    "example": 73675
                },
                "notes": {
                    "type": "string",
                    "example": "updated note"
                },
                "starttime": {
                    "type": "string",
                    "example": "2026-04-21T23:41:44.870Z"
                },
                "timespent": {
                    "type": "integer",
                    "example": 240
                }
            }
        },
        "handlers.TrackingOptionsToItemsPayload": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "trackingOptionId": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.UpdateCompanyPayload": {
            "type": "object",
            "properties": {
                "avatarname": {
                    "type": "string",
                    "example": "avatar.jpg"
                },
                "categoryid": {
                    "description": "Additional fields",
                    "type": "integer",
                    "example": 1
                },
                "code": {
                    "type": "string",
                    "example": "ABC"
                },
                "creatorid": {
                    "type": "integer",
                    "example": 1
                },
                "email": {
                    "type": "string",
                    "example": "info@abc.com"
                },
                "facebook": {
                    "description": "Social media",
                    "type": "string",
                    "example": "https://facebook.com/abc"
                },
                "fax": {
                    "type": "string",
                    "example": "123-456-7891"
                },
                "isperson": {
                    "type": "boolean"
                },
                "linkedin": {
                    "type": "string",
                    "example": "https://linkedin.com/company/abc"
                },
                "maincompanylocationid": {
                    "type": "integer",
                    "example": 1
                },
                "maincontactid": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "description": "Basic fields",
                    "type": "string",
                    "example": "ABC Corporation"
                },
                "phone": {
                    "description": "Contact information",
                    "type": "string",
                    "example": "123-456-7890"
                },
                "tagid": {
                    "description": "Tags",
                    "type": "string",
                    "example": "1,2,3"
                },
                "twitter": {
                    "type": "string",
                    "example": "@abccorp"
                },
                "type": {
                    "type": "string",
                    "enum": [
                        "client",
                        "contractor",
                        "staff",
                        "other"
                    ],
                    "example": "client"
                },
                "website": {
                    "type": "string",
                    "example": "https://www.abc.com"
                }
            }
        },
        "handlers.UpdateContactGroupsPayload": {
            "type": "object",
            "properties": {
                "groupid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.UpdateContactNotePayload": {
            "type": "object",
            "properties": {
                "note": {
                    "type": "string",
                    "example": "Updated note about the contact"
                }
            }
        },
        "handlers.UpdateContactPayload": {
            "type": "object",
            "properties": {
                "address1": {
                    "description": "Address",
                    "type": "string",
                    "example": "123 Main St"
                },
                "address2": {
                    "type": "string",
                    "example": "Suite 100"
                },
                "address3": {
                    "type": "string",
                    "example": ""
                },
                "allowlogin": {
                    "description": "Login/Access",
                    "type": "boolean",
                    "example": true
                },
                "city": {
                    "type": "string",
                    "example": "New York"
                },
                "companyFavouriteId": {
                    "description": "Favorites",
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "companyid": {
                    "description": "Company/Organization",
                    "type": "integer",
                    "example": 1
                },
                "country": {
                    "type": "string",
                    "example": "USA"
                },
                "defaulthourlyrateid": {
                    "description": "Additional",
                    "type": "integer",
                    "example": 1
                },
                "divisionid": {
                    "type": "integer",
                    "example": 1
                },
                "email": {
                    "type": "string",
                    "example": "john@example.com"
                },
                "emailsignature": {
                    "description": "Settings",
                    "type": "string",
                    "example": "\u003cp\u003eBest regards,\u003cbr\u003eJohn\u003c/p\u003e"
                },
                "firstname": {
                    "description": "Basic information",
                    "type": "string",
                    "example": "John"
                },
                "groupid": {
                    "description": "Alias",
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "groupids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "ianatimezone": {
                    "type": "string",
                    "example": "Pacific/Auckland"
                },
                "itemFavouriteId": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "lastname": {
                    "type": "string",
                    "example": "Smith"
                },
                "mobilephone": {
                    "type": "string",
                    "example": "123-456-7891"
                },
                "primarycontact": {
                    "type": "boolean"
                },
                "productFavouriteId": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "projectFavouriteId": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "reportFavouriteId": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "showhistoric": {
                    "type": "boolean"
                },
                "state": {
                    "type": "string",
                    "example": "NY"
                },
                "tagid": {
                    "description": "Tags",
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "title": {
                    "type": "string",
                    "example": "CEO"
                },
                "workphone": {
                    "description": "Contact information",
                    "type": "string",
                    "example": "123-456-7890"
                },
                "zipcode": {
                    "type": "string",
                    "example": "10001"
                }
            }
        },
        "handlers.UpdateContactTagPayload": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "name": {
                    "type": "string",
                    "example": "VIP"
                }
            }
        },
        "handlers.UpdateContactTagsPayload": {
            "type": "object",
            "properties": {
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.UpdateCustomFieldOptionPayload": {
            "type": "object",
            "properties": {
                "displayorder": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "handlers.UpdateCustomFieldPayload": {
            "type": "object",
            "properties": {
                "displayorder": {
                    "type": "integer"
                },
                "isActive": {
                    "type": "boolean"
                },
                "name": {
                    "type": "string"
                },
                "staffonly": {
                    "type": "boolean"
                }
            }
        },
        "handlers.UpdateDivisionPayload": {
            "type": "object",
            "properties": {
                "chargeRateType": {
                    "type": "string",
                    "example": "hourly"
                },
                "costRateType": {
                    "type": "string",
                    "example": "hourly"
                },
                "currencyid": {
                    "type": "integer",
                    "example": 1
                },
                "defaultpayrate": {
                    "type": "number",
                    "example": 50
                },
                "ianatimezone": {
                    "type": "string",
                    "example": "0"
                },
                "name": {
                    "type": "string",
                    "example": "Engineering Division"
                },
                "payratemultiplier": {
                    "type": "number",
                    "example": 1.5
                }
            }
        },
        "handlers.UpdateFolderPayload": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "description": {
                    "type": "string",
                    "example": "Assets for client review"
                },
                "name": {
                    "type": "string",
                    "example": "Client Assets"
                },
                "public": {
                    "type": "boolean",
                    "example": false
                },
                "size": {
                    "type": "integer",
                    "example": 204800
                },
                "taskid": {
                    "type": "integer",
                    "example": 5
                },
                "type": {
                    "type": "string",
                    "example": "custom"
                }
            }
        },
        "handlers.UpdateGroupPayload": {
            "type": "object",
            "properties": {
                "contactids": {
                    "type": "string",
                    "example": "1,2,3"
                },
                "name": {
                    "type": "string",
                    "example": "Design Team"
                },
                "sortorder": {
                    "type": "string",
                    "example": "1"
                }
            }
        },
        "handlers.UpdateInvoiceItemOrderRequest": {
            "type": "object",
            "properties": {
                "placeafterid": {
                    "type": "integer",
                    "example": 123
                },
                "placebeforeid": {
                    "type": "integer",
                    "example": 456
                }
            }
        },
        "handlers.UpdateInvoiceOrderRequest": {
            "type": "object",
            "properties": {
                "placeafterid": {
                    "type": "integer",
                    "example": 123
                },
                "placebeforeid": {
                    "type": "integer",
                    "example": 456
                }
            }
        },
        "handlers.UpdateInvoicePayload": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 1
                },
                "address1": {
                    "description": "Address fields",
                    "type": "string",
                    "example": "123 Main St"
                },
                "address2": {
                    "type": "string",
                    "example": "Suite 100"
                },
                "address3": {
                    "type": "string",
                    "example": ""
                },
                "autonumber": {
                    "description": "Flags",
                    "type": "boolean"
                },
                "city": {
                    "type": "string",
                    "example": "New York"
                },
                "clientcompany": {
                    "description": "Company/Client info",
                    "type": "string",
                    "example": "Acme Corp"
                },
                "clientcontactname": {
                    "type": "string",
                    "example": "John Smith"
                },
                "contactfooter": {
                    "type": "string",
                    "example": "Contact us at..."
                },
                "country": {
                    "type": "string",
                    "example": "USA"
                },
                "customfieldvalue": {
                    "description": "Custom fields",
                    "type": "string",
                    "example": "REF-001"
                },
                "description": {
                    "type": "string",
                    "example": "Updated description"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "footerdetails": {
                    "type": "string",
                    "example": "Thank you for your business"
                },
                "invoicedate": {
                    "description": "Dates",
                    "type": "string",
                    "example": "2024-01-15"
                },
                "invoicetermid": {
                    "description": "Payment/Financial",
                    "type": "integer",
                    "example": 1
                },
                "layoutid": {
                    "type": "integer",
                    "example": 1
                },
                "number": {
                    "type": "string",
                    "example": "INV-001"
                },
                "pagesubtitle": {
                    "type": "string",
                    "example": "Payment Due"
                },
                "pagetitle": {
                    "description": "Layout/Display",
                    "type": "string",
                    "example": "Invoice"
                },
                "paymentdetails": {
                    "type": "string",
                    "example": "Bank transfer details"
                },
                "paymentperiod": {
                    "type": "integer",
                    "example": 30
                },
                "paymentterms": {
                    "type": "string",
                    "example": "Net 30"
                },
                "purchaseordernumber": {
                    "type": "string",
                    "example": "PO-12345"
                },
                "showItemDescription": {
                    "type": "boolean"
                },
                "showPhases": {
                    "type": "boolean"
                },
                "showcostbreakdown": {
                    "type": "boolean"
                },
                "state": {
                    "type": "string",
                    "example": "NY"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "submitted",
                        "authorised",
                        "paid",
                        "voided"
                    ],
                    "example": "submitted"
                },
                "taxable": {
                    "type": "boolean",
                    "example": true
                },
                "taxrate": {
                    "type": "number",
                    "example": 15
                },
                "template": {
                    "type": "boolean"
                },
                "title": {
                    "description": "Basic fields",
                    "type": "string",
                    "example": "Updated Invoice Title"
                },
                "zipcode": {
                    "type": "string",
                    "example": "10001"
                }
            }
        },
        "handlers.UpdateInvoicePhasePayload": {
            "type": "object",
            "properties": {
                "billamount": {
                    "type": "number",
                    "example": 6000
                },
                "billtype": {
                    "type": "integer",
                    "example": 1
                },
                "budget": {
                    "type": "number",
                    "example": 5000
                },
                "budgettype": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Updated Phase Name"
                }
            }
        },
        "handlers.UpdateInvoiceWorkStageRequest": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 9
                }
            }
        },
        "handlers.UpdateItemCategoryPayload": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "name": {
                    "type": "string",
                    "example": "Design"
                },
                "sortorder": {
                    "type": "string",
                    "example": "1"
                }
            }
        },
        "handlers.UpdateItemOrderRequest": {
            "type": "object",
            "properties": {
                "placeafterid": {
                    "type": "integer",
                    "example": 123
                },
                "placebeforeid": {
                    "type": "integer",
                    "example": 456
                }
            }
        },
        "handlers.UpdateItemPayload": {
            "type": "object",
            "properties": {
                "billType": {
                    "type": "integer",
                    "example": 1
                },
                "budgetType": {
                    "type": "integer",
                    "example": 1
                },
                "categoryid": {
                    "type": "integer",
                    "example": 1
                },
                "chargeRateType": {
                    "type": "integer",
                    "example": 1
                },
                "code": {
                    "type": "string",
                    "example": "TASK-001"
                },
                "completedate": {
                    "type": "string",
                    "example": "2024-02-20"
                },
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "costRateType": {
                    "type": "integer",
                    "example": 1
                },
                "description": {
                    "type": "string",
                    "example": "Design the homepage layout"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "effortScore": {
                    "type": "string",
                    "example": "medium"
                },
                "effortScoreId": {
                    "type": "integer",
                    "example": 2
                },
                "hourlyrateserviceid": {
                    "type": "integer",
                    "example": 1
                },
                "impactScore": {
                    "type": "string",
                    "example": "high"
                },
                "impactScoreId": {
                    "type": "integer",
                    "example": 1
                },
                "importanceScore": {
                    "type": "string",
                    "example": "high"
                },
                "importanceScoreId": {
                    "type": "integer",
                    "example": 1
                },
                "inAccountingCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "inLabourPrice": {
                    "type": "number",
                    "example": 40
                },
                "inTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "inUnitId": {
                    "type": "integer",
                    "example": 1
                },
                "inUnitPrice": {
                    "type": "number",
                    "example": 50
                },
                "inUnitQty": {
                    "type": "number",
                    "example": 10.5
                },
                "itemcollectionid": {
                    "type": "integer",
                    "example": 5
                },
                "itemtypeid": {
                    "type": "integer",
                    "example": 1
                },
                "manualPercentageComplete": {
                    "type": "number",
                    "example": 75.5
                },
                "name": {
                    "type": "string",
                    "example": "Design Homepage"
                },
                "outAccountingCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "outLabourPrice": {
                    "type": "number",
                    "example": 60
                },
                "outLabourPriceMultiplier": {
                    "type": "number",
                    "example": 1.5
                },
                "outTaxCodeId": {
                    "type": "integer",
                    "example": 1
                },
                "outUnitId": {
                    "type": "integer",
                    "example": 1
                },
                "outUnitPrice": {
                    "type": "number",
                    "example": 75
                },
                "outUnitPriceMultiplier": {
                    "type": "number",
                    "example": 1.5
                },
                "outUnitQty": {
                    "type": "number",
                    "example": 10.5
                },
                "parentid": {
                    "type": "integer",
                    "example": 2
                },
                "prerequisiteid": {
                    "type": "string",
                    "example": "1,2,3"
                },
                "priority": {
                    "type": "integer",
                    "example": 3
                },
                "priorityid": {
                    "type": "integer",
                    "example": 3
                },
                "productid": {
                    "type": "integer",
                    "example": 4
                },
                "projectedTimeManual": {
                    "type": "integer",
                    "example": 7200
                },
                "projectedTimeSpent": {
                    "type": "integer",
                    "example": 3600
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "complete"
                    ],
                    "example": "active"
                },
                "storyPoints": {
                    "type": "integer",
                    "example": 5
                },
                "tagid": {
                    "type": "string",
                    "example": "1,2"
                },
                "trackingOptionId": {
                    "type": "string",
                    "example": "1,2"
                },
                "urgencyScore": {
                    "type": "string",
                    "example": "medium"
                },
                "urgencyScoreId": {
                    "type": "integer",
                    "example": 2
                }
            }
        },
        "handlers.UpdateItemTagPayload": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "name": {
                    "type": "string",
                    "example": "Urgent"
                }
            }
        },
        "handlers.UpdateItemWorkStageRequest": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 9
                }
            }
        },
        "handlers.UpdateMessagePayload": {
            "type": "object",
            "properties": {
                "notifications": {
                    "type": "boolean",
                    "example": true
                },
                "public": {
                    "type": "boolean",
                    "example": false
                }
            }
        },
        "handlers.UpdateProjectBookmarkPayload": {
            "type": "object",
            "properties": {
                "title": {
                    "type": "string",
                    "example": "Example Site"
                },
                "url": {
                    "type": "string",
                    "example": "https://example.com"
                }
            }
        },
        "handlers.UpdateProjectCategoryPayload": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "name": {
                    "type": "string",
                    "example": "Marketing"
                },
                "sortorder": {
                    "type": "string",
                    "example": "1"
                }
            }
        },
        "handlers.UpdateProjectContactsPayload": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.UpdateProjectCustomFieldPayload": {
            "type": "object",
            "properties": {
                "customfieldoptionid": {
                    "description": "Option ID for dropdown type fields. Alternatively pass the option ID as value.",
                    "type": "integer",
                    "example": 5
                },
                "type": {
                    "description": "Type of the custom field.",
                    "type": "string",
                    "enum": [
                        "checkbox",
                        "date",
                        "dropdown",
                        "number",
                        "percentage",
                        "rating",
                        "staff",
                        "text"
                    ],
                    "example": "text"
                },
                "value": {
                    "description": "Value for the custom field. Pass as a string for checkbox (\"checked\"/\"unchecked\"),\ndate (\"YYYY-MM-DD\"), rating, and text types. Pass as a number for number, percentage,\nstaff (contact ID), and dropdown (customfieldoption ID) types.",
                    "type": "string",
                    "example": "some text"
                }
            }
        },
        "handlers.UpdateProjectItemPayload": {
            "type": "object",
            "properties": {
                "categoryid": {
                    "type": "integer",
                    "example": 1
                },
                "code": {
                    "type": "string",
                    "example": "TASK-001"
                },
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "description": {
                    "type": "string",
                    "example": "Create homepage design mockups"
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-01-20"
                },
                "name": {
                    "type": "string",
                    "example": "Design homepage"
                },
                "priority": {
                    "type": "integer",
                    "example": 2
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15"
                },
                "tagids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                }
            }
        },
        "handlers.UpdateProjectOrderRequest": {
            "type": "object",
            "properties": {
                "placeafterid": {
                    "type": "integer",
                    "example": 123
                },
                "placebeforeid": {
                    "type": "integer",
                    "example": 456
                }
            }
        },
        "handlers.UpdateProjectPayload": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 1
                },
                "categoryid": {
                    "description": "Categorization",
                    "type": "integer",
                    "example": 1
                },
                "chargeRateType": {
                    "type": "integer",
                    "example": 1
                },
                "clientaccess": {
                    "description": "Access settings",
                    "type": "boolean"
                },
                "clientid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "clientviewalltasks": {
                    "type": "boolean"
                },
                "companyid": {
                    "description": "Client/Company fields",
                    "type": "integer",
                    "example": 5
                },
                "completedate": {
                    "type": "string",
                    "example": "2024-04-01"
                },
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "contractorid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        4,
                        5
                    ]
                },
                "costRateType": {
                    "description": "Financial fields",
                    "type": "integer",
                    "example": 1
                },
                "customfields": {
                    "description": "Custom field values to set on update",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ProjectCustomFieldInput"
                    }
                },
                "customformtitle": {
                    "type": "string",
                    "example": "Custom Form"
                },
                "description": {
                    "type": "string",
                    "example": "Complete website redesign project"
                },
                "divisionid": {
                    "description": "Division/Organization",
                    "type": "integer",
                    "example": 1
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-03-15"
                },
                "groupid": {
                    "type": "integer",
                    "example": 1
                },
                "icalcontactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2
                    ]
                },
                "managerid": {
                    "description": "Management team",
                    "type": "integer",
                    "example": 1
                },
                "notification": {
                    "type": "boolean"
                },
                "number": {
                    "type": "string",
                    "example": "PRJ-001"
                },
                "priorityid": {
                    "type": "integer",
                    "example": 2
                },
                "privatenotes": {
                    "description": "Additional fields",
                    "type": "string",
                    "example": "Internal notes"
                },
                "purchaseorder": {
                    "type": "string",
                    "example": "PO-12345"
                },
                "staffid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "staffviewalltasks": {
                    "type": "boolean"
                },
                "startdate": {
                    "description": "Date fields",
                    "type": "string",
                    "example": "2024-01-15"
                },
                "tagid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                },
                "teamid": {
                    "type": "integer",
                    "example": 1
                },
                "template": {
                    "type": "boolean"
                },
                "templateused": {
                    "type": "integer",
                    "example": 1
                },
                "timeallocated": {
                    "type": "integer",
                    "example": 3600
                },
                "title": {
                    "description": "Basic fields",
                    "type": "string",
                    "example": "Website Redesign"
                },
                "worktypeid": {
                    "type": "integer",
                    "example": 1
                }
            }
        },
        "handlers.UpdateProjectPhasePayload": {
            "type": "object",
            "properties": {
                "duedate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "name": {
                    "type": "string",
                    "example": "Design Phase"
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-15"
                }
            }
        },
        "handlers.UpdateProjectSettingsPayload": {
            "type": "object",
            "properties": {
                "clientaccess": {
                    "type": "boolean",
                    "example": true
                },
                "clientviewalltasks": {
                    "type": "boolean",
                    "example": false
                },
                "clientviewtime": {
                    "type": "boolean",
                    "example": false
                },
                "middlecontainerorder": {
                    "type": "string",
                    "example": "tasks,phases"
                },
                "notification": {
                    "type": "boolean",
                    "example": true
                },
                "rightcontainerorder": {
                    "type": "string",
                    "example": "messages,files"
                },
                "staffviewalltasks": {
                    "type": "boolean",
                    "example": true
                }
            }
        },
        "handlers.UpdateProjectTagPayload": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "name": {
                    "type": "string",
                    "example": "Urgent"
                }
            }
        },
        "handlers.UpdateProjectWorkStageRequest": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 9
                }
            }
        },
        "handlers.UpdateQuoteItemOrderRequest": {
            "type": "object",
            "properties": {
                "placeafterid": {
                    "type": "integer",
                    "example": 123
                },
                "placebeforeid": {
                    "type": "integer",
                    "example": 456
                }
            }
        },
        "handlers.UpdateQuoteItemPayload": {
            "type": "object",
            "properties": {
                "billamount": {
                    "type": "number",
                    "example": 6000
                },
                "billtype": {
                    "type": "integer",
                    "example": 1
                },
                "budget": {
                    "type": "number",
                    "example": 5000
                },
                "budgettype": {
                    "type": "integer",
                    "example": 1
                },
                "categoryid": {
                    "type": "integer",
                    "example": 2
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-01-31"
                },
                "itemcollectionid": {
                    "type": "integer",
                    "example": 456
                },
                "itemtypeid": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Updated Design Work"
                },
                "parentid": {
                    "type": "integer",
                    "example": 0
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-01"
                },
                "timeallocated": {
                    "type": "number",
                    "example": 40
                }
            }
        },
        "handlers.UpdateQuoteOrderRequest": {
            "type": "object",
            "properties": {
                "placeafterid": {
                    "type": "integer",
                    "example": 123
                },
                "placebeforeid": {
                    "type": "integer",
                    "example": 456
                }
            }
        },
        "handlers.UpdateQuotePayload": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 1
                },
                "address1": {
                    "description": "Address fields",
                    "type": "string",
                    "example": "123 Main St"
                },
                "address2": {
                    "type": "string",
                    "example": "Suite 100"
                },
                "address3": {
                    "type": "string"
                },
                "approveddate": {
                    "type": "string",
                    "example": "2024-01-20"
                },
                "city": {
                    "type": "string",
                    "example": "New York"
                },
                "clientaccess": {
                    "description": "Flags",
                    "type": "boolean"
                },
                "clientcompany": {
                    "type": "string",
                    "example": "Acme Corp"
                },
                "clientcontactname": {
                    "type": "string",
                    "example": "John Smith"
                },
                "companyid": {
                    "description": "Company/Client info",
                    "type": "integer",
                    "example": 5
                },
                "contactfooter": {
                    "type": "string",
                    "example": "Contact us at..."
                },
                "country": {
                    "type": "string",
                    "example": "USA"
                },
                "customfieldvalue": {
                    "description": "Custom fields",
                    "type": "string",
                    "example": "REF-001"
                },
                "description": {
                    "type": "string",
                    "example": "Updated description"
                },
                "footerdetails": {
                    "type": "string",
                    "example": "Thank you for considering our services"
                },
                "layoutid": {
                    "type": "integer",
                    "example": 1
                },
                "number": {
                    "type": "string",
                    "example": "QUO-001"
                },
                "pagetitle": {
                    "description": "Layout/Display",
                    "type": "string",
                    "example": "Quote"
                },
                "quotedate": {
                    "description": "Dates",
                    "type": "string",
                    "example": "2024-01-15"
                },
                "quotedby": {
                    "type": "string",
                    "example": "Jane Doe"
                },
                "quoteperiod": {
                    "type": "integer",
                    "example": 30
                },
                "showItemDescription": {
                    "type": "boolean"
                },
                "showPhases": {
                    "type": "boolean"
                },
                "showcostbreakdown": {
                    "type": "boolean"
                },
                "state": {
                    "type": "string",
                    "example": "NY"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "pending",
                        "sent",
                        "accepted",
                        "declined"
                    ],
                    "example": "sent"
                },
                "taxable": {
                    "type": "boolean",
                    "example": true
                },
                "taxrate": {
                    "description": "Financial",
                    "type": "number",
                    "example": 15
                },
                "template": {
                    "type": "boolean"
                },
                "terms": {
                    "type": "string",
                    "example": "Terms and conditions"
                },
                "title": {
                    "description": "Basic fields",
                    "type": "string",
                    "example": "Updated Quote Title"
                },
                "validdate": {
                    "type": "string",
                    "example": "2024-02-15"
                },
                "zerotaxtext": {
                    "type": "string",
                    "example": "Tax exempt"
                },
                "zipcode": {
                    "type": "string",
                    "example": "10001"
                }
            }
        },
        "handlers.UpdateQuotePhasePayload": {
            "type": "object",
            "properties": {
                "billamount": {
                    "type": "number",
                    "example": 6000
                },
                "billtype": {
                    "type": "integer",
                    "example": 1
                },
                "budget": {
                    "type": "number",
                    "example": 5000
                },
                "budgettype": {
                    "type": "integer",
                    "example": 1
                },
                "duedate": {
                    "type": "string",
                    "example": "2024-01-31"
                },
                "name": {
                    "type": "string",
                    "example": "Updated Phase Name"
                },
                "startdate": {
                    "type": "string",
                    "example": "2024-01-01"
                }
            }
        },
        "handlers.UpdateQuoteWorkStageRequest": {
            "type": "object",
            "properties": {
                "activeworkstageid": {
                    "type": "integer",
                    "example": 9
                }
            }
        },
        "handlers.UpdateResthookPayload": {
            "type": "object",
            "properties": {
                "divisionid": {
                    "type": "integer",
                    "example": 1
                },
                "event": {
                    "type": "string",
                    "enum": [
                        "newcontact",
                        "newpendingcontact",
                        "editcontact",
                        "editcontactlocation",
                        "deletecontact",
                        "newcompany",
                        "newpendingcompany",
                        "editcompany",
                        "deletecompany",
                        "newfile",
                        "deletefile",
                        "newinvoice",
                        "editinvoice",
                        "deleteinvoice",
                        "newmessage",
                        "editmessage",
                        "deletemessage",
                        "newproject",
                        "editproject",
                        "editstageproject",
                        "deleteproject",
                        "completeproject",
                        "restoreProject",
                        "newprojectrequest",
                        "editprojectrequest",
                        "deleteprojectrequest",
                        "approveprojectrequest",
                        "declineprojectrequest",
                        "newquote",
                        "editquote",
                        "deletequote",
                        "newsharednote",
                        "editsharednote",
                        "deletesharednote",
                        "newtask",
                        "edittask",
                        "deletetask",
                        "completetask",
                        "reactivatetask",
                        "newtime",
                        "edittime",
                        "deletetime",
                        "starttimer",
                        "stoptimer",
                        "unknown"
                    ],
                    "example": "newproject"
                },
                "url": {
                    "type": "string",
                    "example": "https://example.com/webhook"
                }
            }
        },
        "handlers.UpdateRolePayload": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "A4C0DE"
                },
                "contactid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "displayorder": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Project Manager"
                },
                "permissions": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SetRolePermissionInput"
                    }
                }
            }
        },
        "handlers.UpdateTeamPayload": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string",
                    "example": "ENG"
                },
                "groupids": {
                    "type": "string",
                    "example": "1,2,3"
                },
                "name": {
                    "type": "string",
                    "example": "Engineering"
                },
                "sortorder": {
                    "type": "string",
                    "example": "1"
                }
            }
        },
        "handlers.UpdateTimelogContactRequest": {
            "type": "object",
            "properties": {
                "contactid": {
                    "type": "integer",
                    "example": 5
                },
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.UpdateTimelogInvoiceItemRequest": {
            "type": "object",
            "properties": {
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.UpdateTimelogRateRequest": {
            "type": "object",
            "properties": {
                "hourlyrateserviceid": {
                    "type": "integer",
                    "example": 7
                },
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.UpdateTimelogUnInvoiceRequest": {
            "type": "object",
            "properties": {
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        1,
                        2,
                        3
                    ]
                }
            }
        },
        "handlers.WorkStageListResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.WorkStageResponse"
                    }
                },
                "meta": {
                    "$ref": "#/definitions/models.MetaResponse"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.WorkStageResponse": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string",
                    "example": "#2E86C1"
                },
                "deleted": {
                    "type": "boolean",
                    "example": false
                },
                "divisionid": {
                    "type": "integer",
                    "example": 1
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "In Progress"
                },
                "nextstage": {
                    "type": "boolean",
                    "example": false
                },
                "type": {
                    "type": "string",
                    "example": "project"
                },
                "workstate": {
                    "type": "string",
                    "example": "active"
                },
                "worktypeid": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                }
            }
        },
        "handlers.settingsAccountData": {
            "type": "object",
            "properties": {
                "accounttype": {
                    "type": "string",
                    "example": "business"
                },
                "accounturl": {
                    "type": "string",
                    "example": "mycompany.proworkflow.com"
                },
                "currency": {
                    "type": "string",
                    "example": "USD"
                },
                "dateformat": {
                    "type": "string",
                    "example": "dd/mm/yyyy"
                },
                "looknfeel": {
                    "$ref": "#/definitions/handlers.settingsAccountLooknfeel"
                },
                "plan": {
                    "$ref": "#/definitions/handlers.settingsAccountPlan"
                },
                "projectvariable": {
                    "type": "string",
                    "example": "project"
                },
                "taskordering": {
                    "type": "string",
                    "example": "manual"
                },
                "time": {
                    "type": "string",
                    "example": "24"
                },
                "timetrackinginactivetasks": {
                    "type": "string",
                    "example": "false"
                }
            }
        },
        "handlers.settingsAccountLooknfeel": {
            "type": "object",
            "properties": {
                "colors": {
                    "$ref": "#/definitions/handlers.settingsAccountLooknfeelColors"
                },
                "colorscheme": {
                    "type": "string",
                    "example": "default"
                },
                "logo": {
                    "type": "string",
                    "example": "https://cdn.proworkflow.com/images/logo.png"
                }
            }
        },
        "handlers.settingsAccountLooknfeelColors": {
            "type": "object",
            "properties": {
                "headerprimary": {
                    "type": "string",
                    "example": "#1a73e8"
                },
                "headersecondary": {
                    "type": "string",
                    "example": "#1558b0"
                },
                "headertext": {
                    "type": "string",
                    "example": "#ffffff"
                },
                "linktext": {
                    "type": "string",
                    "example": "#1a73e8"
                },
                "tab": {
                    "type": "string",
                    "example": "#f1f3f4"
                },
                "tabhover": {
                    "type": "string",
                    "example": "#e8eaed"
                }
            }
        },
        "handlers.settingsAccountPlan": {
            "type": "object",
            "properties": {
                "invoices": {
                    "type": "boolean"
                },
                "plan": {
                    "type": "integer"
                },
                "quotes": {
                    "type": "boolean"
                }
            }
        },
        "handlers.settingsAccountPlanData": {
            "type": "object",
            "properties": {
                "invoices": {
                    "type": "boolean"
                },
                "plan": {
                    "type": "string",
                    "example": "Advanced"
                },
                "quotes": {
                    "type": "boolean"
                }
            }
        },
        "handlers.settingsAccountPlanResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.settingsAccountPlanData"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "handlers.settingsAccountResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/handlers.settingsAccountData"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        },
        "models.ErrorResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "status": {
                    "type": "string",
                    "example": "Error"
                }
            }
        },
        "models.MetaResponse": {
            "type": "object",
            "properties": {
                "count": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "models.SuccessResponse": {
            "type": "object",
            "properties": {
                "data": {},
                "message": {
                    "type": "string",
                    "example": "Operation completed"
                },
                "status": {
                    "type": "string",
                    "example": "success"
                }
            }
        }
    },
    "securityDefinitions": {
        "ApiKeyAuth": {
            "description": "API Key authentication. Format: \"xxxx-xxxx-xxxx-xxxx-PWFxxxx\"",
            "type": "apiKey",
            "name": "apikey",
            "in": "header"
        },
        "BearerAuth": {
            "description": "JWT Bearer token. Format: \"Bearer \u003ctoken\u003e\"",
            "type": "apiKey",
            "name": "Authorization",
            "in": "header"
        }
    }
}