{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenAPI Plant Store",
    "description": "A sample API that uses a plant store as an example to demonstrate features in the OpenAPI specification",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.cme.sh"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/link": {
      "get": {
        "description": "Returns all links in a workspace with filter support and pagination",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "description": "The Id of the workspace",
            "schema": {
              "type": "string",
              "description": "The Id of the workspace.",
              "example": "d7sfsfffusf6tss"
            },
            "required": true
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of Links in a page. Defaults to `10`",
            "schema": {
              "type": "integer",
              "format": "int32",
              "description": "Number of Links in a page. Defaults to `10`",
              "default": 10
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor. Defaults to `0`",
            "schema": {
              "type": "integer",
              "format": "int32",
              "description": "Cursor. Defaults to `0`",
              "default": 0
            }
          },
          {
            "name": "orderType",
            "in": "query",
            "description": "Order in which data is returned. With options `asc` and `desc`. Defaults to `desc`",
            "schema": {
              "type": "string",
              "description": "Order in which data is returned. With options `asc` and `desc`. Defaults to `desc`",
              "default": "desc"
            }
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Field on which data is ordered. Defaults to `createdDate`",
            "schema": {
              "type": "string",
              "description": "Field on which data is ordered. Defaults to `createdDate`",
              "default": "createdDate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Links response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "pageInfo": {
                          "type": "object",
                          "properties": {
                            "cursor": {
                              "type": "integer"
                            },
                            "hasNext": {
                              "type": "boolean"
                            },
                            "pageNumber": {
                              "type": "integer"
                            },
                            "pageSize": {
                              "type": "integer"
                            },
                            "totalCount": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            }
                          }
                        },
                        "list": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Link"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "description": "Create a new link for the authenticated workspace.",
        "requestBody": {
          "description": "Create a new link for the authenticated workspace.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewLink"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "boolean" },
                    "data": {
                      "type": "object",
                      "properties": {
                        "linkId": { "type": "string" },
                        "keyWordExist": { "type": "boolean" },
                        "shortUrl": { "type": "string" },
                        "recommendedUrls": { "type": "array", "items": {} },
                        "failToGenerateHash": { "type": "boolean" }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "description": "Update tags or delete a link for the authenticated workspace.",
        "requestBody": {
          "description": "Update tags or delete a link for the authenticated workspace.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLinkTags"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "boolean" },
                    "data": {
                      "$ref": "#/components/schemas/Link"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/link/{linkId}/{workspaceId}": {
      "get": {
        "description": "Get analytics for a link",
        "parameters": [
          {
            "name": "linkId",
            "in": "path",
            "description": "Id of the Link",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspaceId",
            "in": "path",
            "description": "Id of the Workspace",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Link analytics response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Analytics"
                }
              }
            }
          },
          "400": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customDomain": {
      "get": {
        "description": "Returns all domains in a workspace with filter support and pagination",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "description": "The Id of the workspace",
            "schema": {
              "type": "string",
              "description": "The Id of the workspace.",
              "example": "d7sfsfffusf6tss"
            },
            "required": true
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of domains in a page. Defaults to `10`",
            "schema": {
              "type": "integer",
              "format": "int32",
              "description": "Number of domains in a page. Defaults to `10`",
              "default": 10
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor. Defaults to `0`",
            "schema": {
              "type": "integer",
              "format": "int32",
              "description": "Cursor. Defaults to `0`",
              "default": 0
            }
          },
          {
            "name": "orderType",
            "in": "query",
            "description": "Order in which data is returned. With options `asc` and `desc`. Defaults to `desc`",
            "schema": {
              "type": "string",
              "description": "Order in which data is returned. With options `asc` and `desc`. Defaults to `desc`",
              "default": "desc"
            }
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Field on which data is ordered. Defaults to `createdDate`",
            "schema": {
              "type": "string",
              "description": "Field on which data is ordered. Defaults to `createdDate`",
              "default": "createdDate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom domain response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "pageInfo": {
                          "type": "object",
                          "properties": {
                            "cursor": {
                              "type": "integer"
                            },
                            "hasNext": {
                              "type": "boolean"
                            },
                            "pageNumber": {
                              "type": "integer"
                            },
                            "pageSize": {
                              "type": "integer"
                            },
                            "totalCount": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            }
                          }
                        },
                        "list": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CustomDomain"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "description": "Connect a new domain for the authenticated workspace.",
        "requestBody": {
          "description": "Connect a new domain for the authenticated workspace.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewDomain"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "boolean" },
                    "data": {
                      "type": "object",
                      "properties": {
                        "linkId": { "type": "string" },
                        "mandatory": {
                          "type": "object",
                          "properties": {
                            "pointsTo": { "type": "string" },
                            "recordType": { "type": "string" },
                            "hostname": { "type": "string" }
                          }
                        },
                        "optional": {
                          "type": "object",
                          "properties": {
                            "pointsTo": { "type": "string" },
                            "recordType": { "type": "string" },
                            "hostname": { "type": "string" }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "description": "Update settings or delete a domain for the authenticated workspace.",
        "requestBody": {
          "description": "Update settings or delete a domain for the authenticated workspace.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDomain"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "boolean" },
                    "data": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tag": {
      "get": {
        "description": "Returns all tags in a workspace",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "description": "The Id of the workspace",
            "schema": {
              "type": "string",
              "description": "The Id of the workspace.",
              "example": "d7sfsfffusf6tss"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "boolean" },
                    "data": {
                      "type": "array",
                      "items": { "type": "string" }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "description": "Create a new tag for the authenticated workspace.",
        "requestBody": {
          "description": "Create a new link for the authenticated workspace.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewTag"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "boolean" },
                    "data": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "description": "Update tags or delete a link for the authenticated workspace.",
        "requestBody": {
          "description": "Update tags or delete a link for the authenticated workspace.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLinkTags"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "boolean" },
                    "data": {
                      "$ref": "#/components/schemas/Link"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/track/lead": {
      "post": {
        "description": "Track a lead event for a short link",
        "requestBody": {
          "description": "Track a lead event",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackLead"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Lead event tracked successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "timestamp": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/track/sale": {
      "post": {
        "description": "Track a sale event for a short link",
        "requestBody": {
          "description": "Track a sale event",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackSale"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Sale event tracked successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "timestamp": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Plant": {
        "required": ["name"],
        "type": "object",
        "properties": {
          "name": {
            "description": "The name of the plant",
            "type": "string"
          },
          "tag": {
            "description": "Tag to specify the type",
            "type": "string"
          }
        }
      },
      "Analytics": {
        "required": ["name"],
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "freeUserData": {
                "type": "object",
                "properties": {
                  "dropDownData": {
                    "type": "object",
                    "properties": {
                      "countries": {
                        "type": "array",
                        "items": { "type": "string" }
                      },
                      "states": {
                        "type": "array",
                        "items": { "type": "string" }
                      },
                      "cities": {
                        "type": "array",
                        "items": { "type": "string" }
                      },
                      "devices": {
                        "type": "array",
                        "items": { "type": "string" }
                      },
                      "userSelection": { "type": "object" }
                    }
                  },
                  "scoreCardDetails": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "totalClicks": { "type": "integer" },
                          "uniqueCities": {
                            "type": "array",
                            "items": { "type": "string" }
                          },
                          "uniqueCountries": {
                            "type": "array",
                            "items": { "type": "string" }
                          },
                          "uniqueStates": {
                            "type": "array",
                            "items": { "type": "string" }
                          }
                        }
                      },
                      "chart": { "type": "string" }
                    }
                  }
                }
              },
              "linkDetailsData": {
                "type": "object",
                "properties": {
                  "topBrowsers": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "browsers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "count": { "type": "integer" },
                                "browser": { "type": "string" }
                              }
                            }
                          }
                        }
                      },
                      "chart": { "type": "string" },
                      "display": {
                        "type": "object",
                        "properties": {
                          "title": { "type": "string" }
                        }
                      }
                    }
                  },
                  "topDevices": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "devices": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "count": { "type": "integer" },
                                "device": { "type": "string" }
                              }
                            }
                          }
                        }
                      },
                      "chart": { "type": "string" },
                      "display": {
                        "type": "object",
                        "properties": {
                          "title": { "type": "string" }
                        }
                      }
                    }
                  },
                  "topPlatforms": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "devices": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "platform": { "type": "string" },
                                "count": { "type": "integer" }
                              }
                            }
                          }
                        }
                      },
                      "chart": { "type": "string" },
                      "display": {
                        "type": "object",
                        "properties": {
                          "title": { "type": "string" }
                        }
                      }
                    }
                  },
                  "daywiseDevices": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "series": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": { "type": "string" },
                                "data": {
                                  "type": "array",
                                  "items": { "type": "integer" }
                                }
                              }
                            }
                          },
                          "seriesCategory": {
                            "type": "array",
                            "items": { "type": "string" }
                          }
                        }
                      },
                      "chart": { "type": "string" },
                      "display": {
                        "type": "object",
                        "properties": {
                          "title": { "type": "string" }
                        }
                      }
                    }
                  },
                  "topStates": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "count": { "type": "integer" },
                            "state": { "type": "string" }
                          }
                        }
                      },
                      "chart": { "type": "string" },
                      "display": {
                        "type": "object",
                        "properties": {
                          "title": { "type": "string" }
                        }
                      }
                    }
                  },
                  "topCities": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "city": { "type": "string" },
                            "count": { "type": "integer" }
                          }
                        }
                      },
                      "chart": { "type": "string" },
                      "display": {
                        "type": "object",
                        "properties": {
                          "title": { "type": "string" }
                        }
                      }
                    }
                  },
                  "clickTrends": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "totalClicks": { "type": "integer" },
                          "percentageIncrease": { "type": "integer" }
                        }
                      },
                      "chart": { "type": "string" },
                      "display": {
                        "type": "object",
                        "properties": {
                          "title": { "type": "string" }
                        }
                      }
                    }
                  },
                  "monthYearPlatform": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "series": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": { "type": "string" },
                                "data": {
                                  "type": "array",
                                  "items": { "type": "integer" }
                                }
                              }
                            }
                          },
                          "categories": {
                            "type": "array",
                            "items": { "type": "string" }
                          }
                        }
                      },
                      "chart": { "type": "string" },
                      "display": {
                        "type": "object",
                        "properties": {
                          "title": { "type": "string" },
                          "xAxisTitle": { "type": "string" },
                          "yAxis": { "type": "string" }
                        }
                      }
                    }
                  },
                  "hourDayClicks": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "series": {
                            "type": "array",
                            "items": { "type": "integer" }
                          },
                          "categories": {
                            "type": "array",
                            "items": { "type": "integer" }
                          }
                        }
                      },
                      "chart": { "type": "string" },
                      "display": {
                        "type": "object",
                        "properties": {
                          "title": { "type": "string" },
                          "xAxisTitle": { "type": "string" },
                          "yAxis": { "type": "string" }
                        }
                      }
                    }
                  },
                  "clickedCountries": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "array",
                        "items": {
                          "type": "array"
                        }
                      },
                      "chart": { "type": "string" },
                      "display": {
                        "type": "object",
                        "properties": {
                          "title": { "type": "string" },
                          "yAxis": { "type": "string" }
                        }
                      }
                    }
                  }
                }
              },
              "advanceAnalyticsData": {
                "type": "object",
                "properties": {
                  "advAnalytics": {
                    "type": "object",
                    "properties": {
                      "power_parity_recommendation": {
                        "type": "object",
                        "properties": {
                          "name": { "type": "string" },
                          "treeData": {
                            "type": "object",
                            "properties": {
                              "chart": { "type": "string" },
                              "display": {
                                "type": "object",
                                "properties": {
                                  "title": { "type": "string" }
                                }
                              },
                              "data": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "array",
                                  "items": { "type": "string" }
                                }
                              }
                            }
                          },
                          "pieChart": {
                            "type": "object",
                            "properties": {
                              "chart": { "type": "string" },
                              "display": {
                                "type": "object",
                                "properties": {
                                  "title": { "type": "string" }
                                }
                              },
                              "data": {
                                "type": "object",
                                "properties": {
                                  "Prosperity Zones": { "type": "integer" },
                                  "Balanced Economies": { "type": "integer" },
                                  "Economic Struggles": { "type": "integer" }
                                }
                              }
                            }
                          }
                        }
                      },
                      "population_literacy_recommendation": {
                        "type": "object",
                        "properties": {
                          "name": { "type": "string" },
                          "treeData": {
                            "type": "object",
                            "properties": {
                              "chart": { "type": "string" },
                              "display": {
                                "type": "object",
                                "properties": {
                                  "title": { "type": "string" }
                                }
                              },
                              "data": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "array",
                                  "items": { "type": "string" }
                                }
                              }
                            }
                          },
                          "pieChart": {
                            "type": "object",
                            "properties": {
                              "chart": { "type": "string" },
                              "display": {
                                "type": "object",
                                "properties": {
                                  "title": { "type": "string" }
                                }
                              },
                              "data": {
                                "type": "object",
                                "properties": {
                                  "Educational Frontiers": {
                                    "type": "integer"
                                  },
                                  "Diverse Growth Districts": {
                                    "type": "integer"
                                  },
                                  "Emerging Development Corridors": {
                                    "type": "integer"
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      "upi_penetration_recommendation": {
                        "type": "object",
                        "properties": {
                          "name": { "type": "string" },
                          "treeData": {
                            "type": "object",
                            "properties": {
                              "chart": { "type": "string" },
                              "display": {
                                "type": "object",
                                "properties": {
                                  "title": { "type": "string" }
                                }
                              },
                              "data": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "array",
                                  "items": { "type": "string" }
                                }
                              }
                            }
                          },
                          "pieChart": {
                            "type": "object",
                            "properties": {
                              "chart": { "type": "string" },
                              "display": {
                                "type": "object",
                                "properties": {
                                  "title": { "type": "string" }
                                }
                              },
                              "data": {
                                "type": "object",
                                "properties": {
                                  "Advanced UPI Adoption": {
                                    "type": "integer"
                                  },
                                  "Intermediate UPI Integration": {
                                    "type": "integer"
                                  },
                                  "UPI Beginners": { "type": "integer" }
                                }
                              }
                            }
                          }
                        }
                      },
                      "age_groups_recommendation": {
                        "type": "object",
                        "properties": {
                          "name": { "type": "string" },
                          "treeData": {
                            "type": "object",
                            "properties": {
                              "chart": { "type": "string" },
                              "display": {
                                "type": "object",
                                "properties": {
                                  "title": { "type": "string" }
                                }
                              },
                              "data": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "array",
                                  "items": { "type": "string" }
                                }
                              }
                            }
                          },
                          "pieChart": {
                            "type": "object",
                            "properties": {
                              "chart": { "type": "string" },
                              "display": {
                                "type": "object",
                                "properties": {
                                  "title": { "type": "string" }
                                }
                              },
                              "data": {
                                "type": "object",
                                "properties": {
                                  "Youthful EpiCenters": { "type": "integer" },
                                  "Age-Balanced Environments": {
                                    "type": "integer"
                                  },
                                  "Youth Deficient Districts": {
                                    "type": "integer"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "Link": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "The unique identifier of the link in ObjectId format, similar to MongoDB's ObjectId",
            "pattern": "^[0-9a-fA-F]{24}$"
          },
          "workspaceId": {
            "type": "string",
            "description": "The ID of the workspace associated with the link"
          },
          "shortUrl": {
            "type": "string",
            "description": "The shortened URL of the link"
          },
          "longUrl": {
            "type": "string",
            "description": "The original (long) URL of the link"
          },
          "linkActive": {
            "type": "boolean",
            "description": "Indicates if the link is active or not"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tags associated with the link"
          },
          "totalClicks": {
            "type": "integer",
            "description": "The total number of clicks on the link"
          },
          "destinationUrlMetaData": {
            "type": "object",
            "properties": {
              "author": {
                "type": "string",
                "description": "The author of the destination URL"
              },
              "description": {
                "type": "string",
                "description": "The description of the destination URL"
              },
              "image": {
                "type": "string",
                "description": "The image associated with the destination URL"
              },
              "logo": {
                "type": "string",
                "description": "The logo associated with the destination URL"
              },
              "publisher": {
                "type": "string",
                "description": "The publisher of the destination URL"
              },
              "title": {
                "type": "string",
                "description": "The title of the destination URL"
              },
              "url": {
                "type": "string",
                "description": "The URL of the destination"
              },
              "metaTags": {
                "type": "string",
                "description": "Meta tags associated with the destination URL"
              },
              "date": {
                "type": "string",
                "format": "date-time",
                "description": "The date of the destination URL"
              }
            }
          },
          "createdBy": {
            "type": "string",
            "description": "The ID of the user who created the link"
          },
          "modifiedBy": {
            "type": "string",
            "description": "The ID of the user who last modified the link"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time",
            "description": "The date when the link was created"
          }
        }
      },

      "UpdateLinkTags": {
        "allOf": [
          {
            "required": ["workspaceId", "linkId"],
            "type": "object",
            "properties": {
              "workspaceId": {
                "type": "string",
                "nullable": false,
                "description": "Id of the Workspace"
              },
              "linkId": {
                "description": "Id of the Link",
                "type": "string",
                "nullable": false
              },
              "tags": {
                "description": "Tags to be updated to a link",
                "type": "array",
                "items": {
                  "type": "string"
                },
                "nullable": false,
                "default": []
              },
              "deleteLink": {
                "type": "boolean",
                "nullable": false,
                "default": false,
                "description": "Delete a link if set to `true`"
              }
            }
          }
        ]
      },
      "CustomDomain": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "The unique identifier of the custom domain in ObjectId format, similar to MongoDB's ObjectId",
            "pattern": "^[0-9a-fA-F]{24}$"
          },
          "workspaceId": {
            "type": "string",
            "description": "The ID of the workspace associated with the custom domain"
          },
          "domain": {
            "type": "string",
            "description": "The domain name"
          },
          "isSubDomain": {
            "type": "boolean",
            "description": "Indicates if the domain is a subdomain"
          },
          "domainSetupped": {
            "type": "boolean",
            "description": "Indicates if the domain setup is completed"
          },
          "dnsConfigured": {
            "type": "boolean",
            "description": "Indicates if DNS is configured for the domain"
          },
          "sslConfigured": {
            "type": "boolean",
            "description": "Indicates if SSL is configured for the domain"
          },
          "pingVerified": {
            "type": "boolean",
            "description": "Indicates if ping is verified for the domain"
          },
          "nameservers": {
            "type": "array",
            "items": { "type": "string" },
            "description": "Nameservers associated with the domain"
          },
          "registrarName": {
            "type": "string",
            "description": "Name of the domain registrar"
          },
          "registrarWebsite": {
            "type": "string",
            "description": "Website of the domain registrar"
          },
          "deleteDomain": {
            "type": "boolean",
            "description": "Indicates if the domain can be deleted"
          },
          "domainConfig": {
            "type": "object",
            "properties": {
              "httpToHttps": {
                "type": "boolean",
                "description": "Indicates if HTTP to HTTPS redirection is enabled"
              }
            }
          },
          "createdDate": {
            "type": "string",
            "format": "date-time",
            "description": "The date when the custom domain was created"
          },
          "configDetails": {
            "type": "object",
            "properties": {
              "mandatory": {
                "type": "object",
                "properties": {
                  "pointsTo": {
                    "type": "string",
                    "description": "Points to IP address"
                  },
                  "recordType": {
                    "type": "string",
                    "description": "Type of DNS record"
                  },
                  "hostname": {
                    "type": "string",
                    "description": "Hostname"
                  }
                }
              }
            }
          }
        }
      },
      "NewDomain": {
        "allOf": [
          {
            "required": ["workspaceId", "domain"],
            "type": "object",
            "properties": {
              "workspaceId": {
                "type": "string",
                "nullable": false,
                "description": "Id of the Workspace"
              },
              "domain": {
                "description": "The domain name for connecting",
                "type": "string",
                "nullable": false
              }
            }
          }
        ]
      },
      "UpdateDomain": {
        "allOf": [
          {
            "required": ["workspaceId", "customDomainId"],
            "type": "object",
            "properties": {
              "workspaceId": {
                "type": "string",
                "nullable": false,
                "description": "Id of the Workspace"
              },
              "customDomainId": {
                "description": "Id of the domain",
                "type": "string",
                "nullable": false
              },
              "httpToHttps": {
                "type": "boolean",
                "nullable": false,
                "default": false,
                "description": "Update redirection of HTTP to HTTPS for short URLs if set to `true`"
              },
              "deleteDomain": {
                "type": "boolean",
                "nullable": false,
                "default": false,
                "description": "Delete domain if set to `true`"
              }
            }
          }
        ]
      },
      "NewLink": {
        "allOf": [
          {
            "required": ["workspaceId", "keywordType", "longUrl"],
            "type": "object",
            "properties": {
              "workspaceId": {
                "type": "string",
                "nullable": false,
                "description": "Id of the Workspace"
              },
              "keywordType": {
                "description": "The type slug we use for shortening the url. It can be either `HASH` or `CUSTOM`",
                "type": "string",
                "nullable": false
              },
              "longUrl": {
                "description": "The long url for shortening",
                "type": "string",
                "nullable": false
              },
              "customDomain": {
                "description": "The custom domain value if have any custom domain setupped in the workspace to create short url. It can be null if not configured",
                "type": "string",
                "nullable": false,
                "example": "amazon.com"
              },
              "keyword": {
                "type": "string",
                "description": "Custom keyword/slug for shortening url if keywordType selected as `CUSTOM`",
                "nullable": false,
                "example": "myYoutubeChannel"
              }
            }
          }
        ]
      },
      "NewTag": {
        "allOf": [
          {
            "required": ["workspaceId", "tag"],
            "type": "object",
            "properties": {
              "workspaceId": {
                "type": "string",
                "nullable": false,
                "description": "Id of the Workspace"
              },
              "tag": {
                "description": "Value of the tag",
                "type": "string",
                "nullable": false
              }
            }
          }
        ]
      },
      "TrackLead": {
        "type": "object",
        "required": ["clickId", "eventName", "customerExternalId"],
        "properties": {
          "clickId": {
            "type": "string",
            "description": "The unique ID of the click that the lead conversion event is attributed to"
          },
          "mode": {
            "type": "string",
            "description": "The mode of the lead event to track",
            "example": "deferred",
            "nullable": true,
            "default": "non-deferred"
          },
          "eventName": {
            "type": "string",
            "description": "The name of the lead event to track",
            "example": "Sign up"
          },
          "customerExternalId": {
            "type": "string",
            "description": "The unique ID of the customer in your system",
            "example": "user_42"
          },
          "customerName": {
            "type": "string",
            "description": "The name of the customer",
            "nullable": true
          },
          "customerEmail": {
            "type": "string",
            "format": "email",
            "description": "The email address of the customer",
            "nullable": true
          }
        }
      },
      "TrackSale": {
        "type": "object",
        "required": ["clickId", "eventName", "customerExternalId", "invoiceId", "amount", "currency"],
        "properties": {
          "clickId": {
            "type": "string",
            "description": "The unique ID of the click that the sale conversion event is attributed to"
          },
          "eventName": {
            "type": "string",
            "description": "The name of the sale event",
            "example": "purchase_completed"
          },
          "customerExternalId": {
            "type": "string",
            "description": "The unique ID of the customer in your system",
            "example": "user_42"
          },
          "customerName": {
            "type": "string",
            "description": "The name of the customer",
            "nullable": true
          },
          "customerEmail": {
            "type": "string",
            "format": "email",
            "description": "The email address of the customer",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "description": "The sale amount",
            "example": 99.99
          },
          "currency": {
            "type": "string",
            "description": "The currency code (USD, EUR, etc.)",
            "example": "USD"
          },
          "invoiceId": {
            "type": "string",
            "description": "Your invoice or transaction ID",
            "example": "invoice_12345"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "description": "Indicates the status of the error response"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Error code"
                },
                "errorMessage": {
                  "type": "string",
                  "description": "Error message"
                }
              },
              "required": ["code", "errorMessage"]
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
