{
  "openapi": "3.0.1",
  "info": {
    "title": "Chartbrew API reference",
    "description": "The OpenAPI specification for Chartbrew",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.chartbrew.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/team": {
      "post": {
        "description": "Create a new team",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTeam"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Team created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Team"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "description": "Get all teams for the authenticated user",
        "responses": {
          "200": {
            "description": "Array of teams the user is a member of",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserTeams"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}": {
      "get": {
        "description": "Get a team by ID",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Team details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Team"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "description": "Update a team",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTeam"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Team updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Team"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/user/{user_id}": {
      "get": {
        "description": "Get all teams for a user",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "description": "ID of the user",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of teams the user is a member of",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserTeams"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/connections": {
      "get": {
        "description": "Get all connections for a team",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of connections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConnectionResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "description": "Create a new connection",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewConnection"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connection"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/connections/{connection_id}": {
      "get": {
        "description": "Get a connection by ID",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection_id",
            "in": "path",
            "description": "ID of the connection",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connection details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connection"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          },
          "404": {
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "description": "Update a connection",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection_id",
            "in": "path",
            "description": "ID of the connection",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connection"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "description": "Delete a connection",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection_id",
            "in": "path",
            "description": "ID of the connection",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "removeDatasets",
            "in": "query",
            "description": "Whether to remove associated datasets",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connection deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "removed": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/connections/{connection_id}/files": {
      "post": {
        "description": "Add files to a connection (like SSL certificates)",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection_id",
            "in": "path",
            "description": "ID of the connection",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "sslCa": {
                    "type": "string",
                    "format": "binary",
                    "description": "SSL CA certificate file"
                  },
                  "sslCert": {
                    "type": "string",
                    "format": "binary",
                    "description": "SSL certificate file"
                  },
                  "sslKey": {
                    "type": "string",
                    "format": "binary",
                    "description": "SSL key file"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connection"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "No files were uploaded"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not authorized"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/connections/{connection_id}/test": {
      "get": {
        "description": "Test a connection",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection_id",
            "in": "path",
            "description": "ID of the connection",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Test successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/datasets": {
      "get": {
        "description": "Get all datasets for a team",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of datasets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Dataset"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "description": "Create a new dataset",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewDataset"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created dataset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dataset"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/datasets/quick-create": {
      "post": {
        "description": "Quickly create a dataset with all its data requests in one go",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickCreateDataset"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created dataset with all data requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dataset"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/datasets/{dataset_id}": {
      "get": {
        "description": "Get a dataset by ID",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dataset_id",
            "in": "path",
            "description": "ID of the dataset",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dataset object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dataset"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "description": "Update a dataset",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dataset_id",
            "in": "path",
            "description": "ID of the dataset",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated dataset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dataset"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "description": "Delete a dataset",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dataset_id",
            "in": "path",
            "description": "ID of the dataset",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dataset deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "example": true
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/datasets/{dataset_id}/request": {
      "get": {
        "description": "Run the request attached to the dataset",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dataset_id",
            "in": "path",
            "description": "ID of the dataset",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "noSource",
            "in": "query",
            "description": "Skip running the data source",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "getCache",
            "in": "query",
            "description": "Get cached data if available",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "filters",
            "in": "query",
            "description": "Filter parameters for the request",
            "schema": {
              "$ref": "#/components/schemas/DatasetFilters"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dataset with request results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "options": {
                      "$ref": "#/components/schemas/Dataset"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "404": {
            "description": "Dataset not found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/datasets/{dataset_id}/dataRequests": {
      "post": {
        "summary": "Create a new data request",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "dataset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Data request created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataRequest"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "summary": "Get data requests by dataset ID",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "dataset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of data requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DataRequest"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/datasets/{dataset_id}/dataRequests/{id}": {
      "put": {
        "summary": "Update a data request",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "dataset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated data request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataRequest"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "summary": "Delete a data request",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "dataset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Data request deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/request": {
      "post": {
        "summary": "Run a single data request",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "dataset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "noSource": {
                    "type": "boolean"
                  },
                  "getCache": {
                    "type": "boolean"
                  },
                  "filters": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Data request results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataRequestResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/variableBindings": {
      "post": {
        "summary": "Create a new variable binding",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "dataset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VariableBinding"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Variable binding created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataRequest"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/variableBindings/{variable_id}": {
      "put": {
        "summary": "Update a variable binding",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "dataset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "variable_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VariableBinding"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Variable binding updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataRequest"
                }
              }
            }
          }
        }
      }
    },
    "/project": {
      "post": {
        "description": "Create a new dashboard",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewDashboard"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created dashboard",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dashboard"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not authorized"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/{id}": {
      "get": {
        "description": "Get a specific dashboard by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the dashboard",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dashboard response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dashboard"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          },
          "404": {
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "description": "Update a dashboard",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the dashboard",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated dashboard",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dashboard"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "description": "Delete a dashboard",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the dashboard",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dashboard deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "removed": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not authorized"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/team/{team_id}": {
      "get": {
        "description": "Get all dashboards for a team",
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "description": "ID of the team",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of dashboards",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DashboardItem"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/dashboard/{brewName}": {
      "get": {
        "description": "Get a public dashboard by its brew name",
        "parameters": [
          {
            "name": "brewName",
            "in": "path",
            "description": "Brew name of the dashboard",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pass",
            "in": "query",
            "description": "Password for protected dashboards",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "token",
            "in": "query",
            "description": "Access token for SharePolicy-protected dashboards",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public dashboard response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dashboard"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized or access token required"
          },
          "403": {
            "description": "Password required or incorrect, or share policy disabled"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/chart/share/{share_string}": {
      "get": {
        "description": "Get a chart for sharing",
        "parameters": [
          {
            "name": "share_string",
            "in": "path",
            "description": "Share policy's share_string",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "token",
            "in": "query",
            "description": "Access token generated from the SharePolicy",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "theme",
            "in": "query",
            "description": "Theme for the embedded chart (light, dark, os)",
            "schema": {
              "type": "string",
              "enum": [
                "light",
                "dark",
                "os"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Chart data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Chart"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized - chart must be public or valid token required"
          },
          "413": {
            "description": "Payload too large"
          }
        }
      }
    },
    "/project/{id}/share/policy": {
      "post": {
        "description": "Create a share policy for a project",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Created share policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharePolicy"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/{id}/share/policy/{policy_id}": {
      "put": {
        "description": "Update a share policy for a project",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "policy_id",
            "in": "path",
            "description": "ID of the share policy",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SharePolicyUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated share policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharePolicy"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "description": "Delete a share policy for a project",
        "parameters": [
          {
            "name": "policy_id",
            "in": "path",
            "description": "ID of the share policy",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted share policy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/{id}/share/token": {
      "post": {
        "description": "Generate a share token for a project with SharePolicy",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated share token and URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/{project_id}/chart": {
      "get": {
        "description": "Returns all charts for a specific project",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of charts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Chart"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "description": "Creates a new chart in the project",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Chart data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewChart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created chart",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Chart"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/{project_id}/chart/quick-create": {
      "post": {
        "description": "Quickly create a chart with all its chart dataset configs in one go",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickNewChart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created chart with all chart dataset configs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Chart"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/{project_id}/chart/{id}": {
      "get": {
        "description": "Returns a specific chart by ID",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID of the chart",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Chart response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Chart"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "description": "Updates an existing chart",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID of the chart",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "justUpdates",
            "in": "query",
            "description": "Only return updated fields",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "description": "Chart update data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChartUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated chart",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Chart"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "406": {
            "description": "Invalid data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "description": "Delete a specific chart",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID of the chart",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Chart deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/{project_id}/chart/{id}/query": {
      "post": {
        "description": "Run the query for a chart",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID of the chart",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "no_source",
            "in": "query",
            "description": "Skip source data in response",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "skip_parsing",
            "in": "query",
            "description": "Skip data parsing",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "getCache",
            "in": "query",
            "description": "Get cached data if available",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "description": "Query filters",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Chart data response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Chart"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Payload too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/{project_id}/chart/{id}/share/policy": {
      "post": {
        "description": "Create a share policy for a chart",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID of the chart",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Created chart share policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharePolicy"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/{project_id}/chart/{chart_id}/share/policy/{policy_id}": {
      "put": {
        "description": "Update a share policy for a chart",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chart_id",
            "in": "path",
            "description": "ID of the chart",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "policy_id",
            "in": "path",
            "description": "ID of the share policy",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SharePolicyUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated share policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharePolicy"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "description": "Delete a share policy for a chart",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chart_id",
            "in": "path",
            "description": "ID of the chart",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "policy_id",
            "in": "path",
            "description": "ID of the share policy",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted share policy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/{project_id}/chart/{id}/share/token": {
      "post": {
        "description": "Generate a share token for a chart embed",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID of the chart",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChartShareTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated chart share token and URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          },
          "401": {
            "description": "Not authorized"
          },
          "403": {
            "description": "Access denied"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/{project_id}/chart/{id}/chart-dataset-config": {
      "post": {
        "description": "Create a new chart dataset configuration",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID of the chart",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChartDatasetConfig"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created chart dataset configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChartDatasetConfig"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/project/{project_id}/chart/{id}/chart-dataset-config/{cdc_id}": {
      "put": {
        "description": "Update a chart dataset configuration",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID of the chart",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cdc_id",
            "in": "path",
            "description": "ID of the chart dataset configuration",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChartDatasetConfig"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated chart dataset configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChartDatasetConfig"
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "description": "Delete a chart dataset configuration",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID of the chart",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cdc_id",
            "in": "path",
            "description": "ID of the chart dataset configuration",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted chart dataset configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "removed": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Team": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "TeamRoles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamRole"
            }
          },
          "showBranding": {
            "type": "boolean"
          },
          "allowReportRefresh": {
            "type": "boolean"
          },
          "allowReportExport": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateTeam": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "showBranding": {
            "type": "boolean"
          },
          "allowReportRefresh": {
            "type": "boolean"
          },
          "allowReportExport": {
            "type": "boolean"
          }
        }
      },
      "UserTeams": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer"
            },
            "name": {
              "type": "string"
            },
            "TeamRoles": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/TeamRole"
              }
            },
            "Projects": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "Charts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            },
            "Connections": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  }
                }
              }
            },
            "showBranding": {
              "type": "boolean"
            },
            "allowReportRefresh": {
              "type": "boolean"
            },
            "allowReportExport": {
              "type": "boolean"
            },
            "createdAt": {
              "type": "string",
              "format": "date-time"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      },
      "TeamRole": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "team_id": {
            "type": "integer"
          },
          "user_id": {
            "type": "integer"
          },
          "role": {
            "type": "string"
          },
          "projects": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "canExport": {
            "type": "boolean"
          }
        }
      },
      "ConnectionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "team_id": {
            "type": "integer"
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "oauth_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "mongodb",
              "api",
              "mysql",
              "postgres",
              "realtimedb",
              "firestore",
              "googleAnalytics",
              "customerio"
            ]
          },
          "subType": {
            "type": "string",
            "enum": [
              "timescaledb",
              "supabasedb",
              "rdsPostgres",
              "rdsMysql"
            ]
          },
          "active": {
            "type": "boolean",
            "default": true
          },
          "ssl": {
            "type": "boolean",
            "default": false
          },
          "sslMode": {
            "type": "string",
            "default": "require"
          }
        }
      },
      "Connection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "team_id": {
            "type": "integer"
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "oauth_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "mongodb",
              "api",
              "mysql",
              "postgres",
              "realtimedb",
              "firestore",
              "googleAnalytics",
              "customerio"
            ]
          },
          "subType": {
            "type": "string",
            "description": "Used for connections based on main types",
            "enum": [
              "timescaledb",
              "supabasedb",
              "rdsPostgres",
              "rdsMysql",
              "api",
              "mongodb",
              "api",
              "mysql",
              "postgres",
              "realtimedb",
              "firestore",
              "googleAnalytics",
              "customerio"
            ]
          },
          "active": {
            "type": "boolean",
            "default": true
          },
          "host": {
            "type": "string"
          },
          "dbName": {
            "type": "string"
          },
          "port": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "srv": {
            "type": "boolean",
            "default": false
          },
          "options": {
            "type": "object"
          },
          "connectionString": {
            "type": "string",
            "description": "Used for MongoDB, Postgres, and MySQL connections"
          },
          "authentication": {
            "type": "object",
            "description": "Used for API connections",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "bearer_token",
                  "basic_auth"
                ]
              },
              "token": {
                "type": "string"
              },
              "user": {
                "type": "string"
              },
              "pass": {
                "type": "string"
              }
            }
          },
          "firebaseServiceAccount": {
            "type": "object",
            "description": "JSON object containing the Firebase service account credentials"
          },
          "ssl": {
            "type": "boolean",
            "default": false
          },
          "sslMode": {
            "type": "string",
            "default": "require"
          },
          "sslCa": {
            "type": "string"
          },
          "sslCert": {
            "type": "string"
          },
          "sslKey": {
            "type": "string"
          },
          "schema": {
            "type": "object"
          }
        }
      },
      "NewConnection": {
        "type": "object",
        "required": [
          "name",
          "type",
          "team_id"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "mongodb",
              "api",
              "mysql",
              "postgres",
              "realtimedb",
              "firestore",
              "googleAnalytics",
              "customerio"
            ]
          },
          "subType": {
            "type": "string",
            "description": "Used for connections based on main types",
            "enum": [
              "timescaledb",
              "supabasedb",
              "rdsPostgres",
              "rdsMysql",
              "api",
              "mongodb",
              "api",
              "mysql",
              "postgres",
              "realtimedb",
              "firestore",
              "googleAnalytics",
              "customerio"
            ]
          },
          "team_id": {
            "type": "integer"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "options": {
            "type": "object",
            "description": "Used for MongoDB, Postgres, and MySQL connections"
          },
          "authentication": {
            "type": "object",
            "description": "Used for API connections",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "bearer_token",
                  "basic_auth"
                ]
              },
              "token": {
                "type": "string"
              },
              "user": {
                "type": "string"
              },
              "pass": {
                "type": "string"
              }
            }
          },
          "firebaseServiceAccount": {
            "type": "object",
            "description": "JSON object containing the Firebase service account credentials"
          },
          "ssl": {
            "type": "boolean",
            "default": false
          },
          "sslMode": {
            "type": "string",
            "default": "require"
          },
          "schema": {
            "type": "object",
            "description": "Used for Postgres and MySQL. This gets populated automatically whenever the connection is used in a chart."
          }
        }
      },
      "ConnectionUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "options": {
            "type": "object",
            "description": "Used for MongoDB, Postgres, and MySQL connections"
          },
          "type": {
            "type": "string",
            "enum": [
              "mongodb",
              "api",
              "mysql",
              "postgres"
            ]
          },
          "subType": {
            "type": "string",
            "description": "Used for connections based on main types",
            "enum": [
              "timescaledb",
              "supabasedb",
              "rdsPostgres",
              "rdsMysql",
              "api",
              "mongodb",
              "api",
              "mysql",
              "postgres",
              "realtimedb",
              "firestore",
              "googleAnalytics",
              "customerio"
            ]
          },
          "authentication": {
            "type": "object",
            "description": "Used for API connections",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "bearer_token",
                  "basic_auth"
                ]
              },
              "token": {
                "type": "string"
              },
              "user": {
                "type": "string"
              },
              "pass": {
                "type": "string"
              }
            }
          },
          "firebaseServiceAccount": {
            "type": "object",
            "description": "JSON object containing the Firebase service account credentials"
          },
          "ssl": {
            "type": "boolean",
            "default": false
          },
          "sslMode": {
            "type": "string",
            "default": "require"
          },
          "schema": {
            "type": "object",
            "description": "Used for Postgres and MySQL. This gets populated automatically whenever the connection is used in a chart."
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Dataset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "team_id": {
            "type": "integer"
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "chart_id": {
            "type": "integer"
          },
          "connection_id": {
            "type": "integer"
          },
          "draft": {
            "type": "boolean",
            "default": true
          },
          "name": {
            "type": "string",
            "description": "Canonical dataset name. Prefer this over legend when referring to the reusable dataset itself."
          },
          "query": {
            "type": "string"
          },
          "xAxis": {
            "type": "string",
            "description": "[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig."
          },
          "xAxisOperation": {
            "type": "string",
            "description": "[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig."
          },
          "yAxis": {
            "type": "string",
            "description": "[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig."
          },
          "yAxisOperation": {
            "type": "string",
            "default": "none",
            "description": "[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig."
          },
          "dateField": {
            "type": "string",
            "description": "[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig."
          },
          "dateFormat": {
            "type": "string",
            "description": "[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig."
          },
          "legend": {
            "type": "string",
            "description": "[Legacy compatibility] Previous dataset name field. Prefer Dataset.name for reusable dataset naming."
          },
          "fieldsSchema": {
            "type": "object"
          },
          "excludedFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "configuration": {
            "type": "object"
          },
          "joinSettings": {
            "type": "object",
            "properties": {
              "joins": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "dr_id": {
                      "type": "integer",
                      "description": "DataRequest ID"
                    },
                    "join_id": {
                      "type": "integer"
                    },
                    "dr_field": {
                      "type": "string"
                    },
                    "join_field": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "NewDataset": {
        "type": "object",
        "required": [
          "team_id"
        ],
        "properties": {
          "team_id": {
            "type": "integer"
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "name": {
            "type": "string"
          },
          "connection_id": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "datasetColor": {
            "type": "string"
          },
          "dateField": {
            "type": "string"
          },
          "dateFormat": {
            "type": "string"
          },
          "legend": {
            "type": "string",
            "description": "[Legacy compatibility] Previous dataset name field. Prefer name for reusable dataset naming."
          },
          "configuration": {
            "type": "object"
          }
        }
      },
      "QuickCreateDataset": {
        "type": "object",
        "required": [
          "team_id"
        ],
        "description": "Create a dataset with all its data requests in one API call. This endpoint is dataset-focused. Per-chart bindings should be configured on ChartDatasetConfig when creating or updating charts.",
        "properties": {
          "team_id": {
            "type": "integer",
            "description": "ID of the team"
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Array of project IDs where members can access the dataset"
          },
          "draft": {
            "type": "boolean",
            "default": true,
            "description": "Whether the dataset is a draft and should be hidden from dashboard viewers"
          },
          "name": {
            "type": "string",
            "description": "Canonical dataset name."
          },
          "dimension": {
            "type": "string",
            "description": "[Legacy compatibility] Dataset-level xAxis fallback. New per-chart bindings should be set on chartDatasetConfigs[].xAxis."
          },
          "metric": {
            "type": "string",
            "description": "[Legacy compatibility] Dataset-level yAxis fallback. New per-chart bindings should be set on chartDatasetConfigs[].yAxis."
          },
          "metricOperation": {
            "type": "string",
            "default": "none",
            "description": "[Legacy compatibility] Dataset-level yAxisOperation fallback. New per-chart bindings should be set on chartDatasetConfigs[].yAxisOperation.",
            "enum": [
              "none",
              "count",
              "count_unique",
              "sum",
              "avg",
              "min",
              "max"
            ]
          },
          "dateField": {
            "type": "string",
            "description": "[Legacy compatibility] Dataset-level dateField fallback. New per-chart bindings should be set on chartDatasetConfigs[].dateField."
          },
          "dateFormat": {
            "type": "string",
            "description": "[Legacy compatibility] Dataset-level dateFormat fallback. New per-chart bindings should be set on chartDatasetConfigs[].dateFormat."
          },
          "legend": {
            "type": "string",
            "description": "[Legacy compatibility] Previous dataset name field. Prefer name for reusable dataset naming."
          },
          "conditions": {
            "type": "array",
            "description": "[Legacy compatibility] Dataset-level filter fallback. New chart-specific filters should be set on chartDatasetConfigs[].conditions.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "field": {
                  "type": "string",
                  "description": "Field using traversal syntax - root[].field"
                },
                "operator": {
                  "type": "string",
                  "enum": [
                    "is",
                    "isNot",
                    "greaterThan",
                    "lessThan",
                    "greaterThanOrEqual",
                    "lessThanOrEqual",
                    "contains",
                    "notContains",
                    "isNull",
                    "isNotNull"
                  ],
                  "description": "Comparison operator"
                },
                "value": {
                  "type": "string"
                },
                "displayValues": {
                  "type": "boolean",
                  "description": "Whether to display the values in the dropdown UI"
                }
              }
            }
          },
          "fieldsSchema": {
            "type": "object",
            "description": "Schema of the fields in the dataset key(field name) => value(type). This gets populated automatically whenever the dataset is used in a chart."
          },
          "joinSettings": {
            "type": "object",
            "description": "Join settings for the dataset. Use indices (0-based) in joins array to reference data requests before they are created.",
            "properties": {
              "joins": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "dr_id": {
                      "type": "integer",
                      "description": "Index (0-based) of the data request in dataRequests array, or DataRequest ID after creation"
                    },
                    "join_id": {
                      "type": "integer",
                      "description": "Index (0-based) of the join data request in dataRequests array, or DataRequest ID after creation"
                    },
                    "dr_field": {
                      "type": "string",
                      "description": "Field in the dataset to join on"
                    },
                    "join_field": {
                      "type": "string",
                      "description": "Field in the main source data request to join on"
                    },
                    "alias": {
                      "type": "string",
                      "description": "Alias for the joined data"
                    }
                  }
                }
              }
            }
          },
          "dataRequests": {
            "type": "array",
            "description": "Array of data requests to create with the dataset",
            "items": {
              "$ref": "#/components/schemas/QuickCreateDataRequest"
            }
          },
          "main_dr_index": {
            "type": "integer",
            "default": 0,
            "description": "Index (0-based) of the main data request in the dataRequests array. Defaults to 0."
          },
          "variableBindings": {
            "type": "array",
            "description": "Variable bindings for the dataset. The entity_type and entity_id will be automatically set.",
            "items": {
              "$ref": "#/components/schemas/NewVariableBinding"
            }
          }
        }
      },
      "NewVariableBinding": {
        "type": "object",
        "description": "Variable binding to create. entity_type and entity_id are automatically set based on the parent entity.",
        "required": [
          "name",
          "type"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Variable name. Can be provided with or without {{ }} wrapper (e.g., 'myVar' or '{{myVar}}'). The wrapper will be automatically removed."
          },
          "type": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "boolean",
              "date"
            ],
            "description": "Type of the variable"
          },
          "default_value": {
            "type": "string",
            "description": "Default value for the variable"
          },
          "required": {
            "type": "boolean",
            "default": false,
            "description": "Whether the variable is required"
          }
        }
      },
      "DatasetUpdate": {
        "type": "object",
        "properties": {
          "project_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "name": {
            "type": "string"
          },
          "connection_id": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "datasetColor": {
            "type": "string"
          },
          "dateField": {
            "type": "string"
          },
          "dateFormat": {
            "type": "string"
          },
          "legend": {
            "type": "string"
          },
          "configuration": {
            "type": "object"
          },
          "joinSettings": {
            "type": "object",
            "properties": {
              "joins": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "dr_id": {
                      "type": "integer",
                      "description": "DataRequest ID"
                    },
                    "join_id": {
                      "type": "integer"
                    },
                    "dr_field": {
                      "type": "string"
                    },
                    "join_field": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "DatasetFilters": {
        "type": "object",
        "properties": {
          "conditions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "description": "Field name to filter on"
                },
                "operator": {
                  "type": "string",
                  "enum": [
                    "=",
                    "!=",
                    ">",
                    "<",
                    ">=",
                    "<=",
                    "LIKE",
                    "IS NULL",
                    "IS NOT NULL"
                  ],
                  "description": "Comparison operator"
                },
                "value": {
                  "type": "string",
                  "description": "Value to compare against"
                }
              }
            }
          },
          "dateRange": {
            "type": "object",
            "properties": {
              "start": {
                "type": "string",
                "format": "date-time",
                "description": "Start date for filtering"
              },
              "end": {
                "type": "string",
                "format": "date-time",
                "description": "End date for filtering"
              }
            }
          }
        }
      },
      "DataRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "dataset_id": {
            "type": "integer",
            "description": "Reference to Dataset model"
          },
          "connection_id": {
            "type": "integer",
            "description": "Reference to Connection model"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "DELETE",
              "PATCH"
            ]
          },
          "route": {
            "type": "string",
            "description": "API endpoint path"
          },
          "headers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "body": {
            "type": "string",
            "description": "Request body in JSON string format"
          },
          "useGlobalHeaders": {
            "type": "boolean",
            "default": true
          },
          "query": {
            "type": "string"
          },
          "pagination": {
            "type": "boolean",
            "default": false
          },
          "items": {
            "type": "string",
            "default": "items",
            "description": "Path to items array in response"
          },
          "itemsLimit": {
            "type": "integer",
            "default": 0,
            "description": "Maximum number of items to return"
          },
          "offset": {
            "type": "string",
            "default": "offset",
            "description": "Pagination offset field name"
          },
          "paginationField": {
            "type": "string",
            "description": "Field used for pagination"
          },
          "template": {
            "type": "string",
            "description": "Template type for request formatting"
          },
          "conditions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "operator": {
                  "type": "string",
                  "enum": [
                    "=",
                    "!=",
                    ">",
                    "<",
                    ">=",
                    "<=",
                    "LIKE",
                    "IS NULL",
                    "IS NOT NULL"
                  ]
                }
              }
            }
          },
          "configuration": {
            "$ref": "#/components/schemas/DataRequestConfiguration"
          },
          "variables": {
            "type": "object",
            "description": "Request variables",
            "additionalProperties": true
          },
          "Connection": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "subType": {
                "type": "string"
              },
              "host": {
                "type": "string"
              }
            }
          },
          "VariableBindings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VariableBinding"
            }
          }
        }
      },
      "DataRequestConfiguration": {
        "type": "object",
        "description": "Configuration options for data requests. Fields vary by connection type. Only include fields relevant to your connection type.",
        "properties": {
          "populateAttributes": {
            "type": "boolean",
            "description": "Populate attributes for Customer.io"
          },
          "mainCollectionSample": {
            "type": "string",
            "description": "Main collection sample for Firestore"
          },
          "subCollectionSample": {
            "type": "string",
            "description": "Sub collection sample for Firestore"
          },
          "selectedSubCollection": {
            "type": "string",
            "description": "Selected sub collection for Firestore"
          },
          "limit": {
            "type": "number",
            "description": "Limit for Firestore"
          },
          "orderBy": {
            "type": "string",
            "description": "Order by field for Firestore"
          },
          "orderByDirection": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ],
            "description": "Order by direction for Firestore"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID for Google Analytics"
          },
          "propertyId": {
            "type": "string",
            "description": "Property ID for Google Analytics"
          },
          "metrics": {
            "type": "string",
            "description": "Metrics for Google Analytics"
          },
          "dimensions": {
            "type": "string",
            "description": "Dimensions for Google Analytics"
          },
          "startDate": {
            "type": "string",
            "description": "Start date for Google Analytics"
          },
          "endDate": {
            "type": "string",
            "description": "End date for Google Analytics"
          },
          "limitToLast": {
            "type": "number",
            "description": "Limit to last for RealtimeDB"
          },
          "limitToFirst": {
            "type": "number",
            "description": "Limit to first for RealtimeDB"
          }
        },
        "additionalProperties": true
      },
      "NewDataRequest": {
        "type": "object",
        "properties": {
          "dataset_id": {
            "type": "integer"
          },
          "connection_id": {
            "type": "integer"
          },
          "query": {
            "type": "string"
          },
          "configuration": {
            "$ref": "#/components/schemas/DataRequestConfiguration"
          }
        }
      },
      "QuickCreateDataRequest": {
        "type": "object",
        "properties": {
          "connection_id": {
            "type": "integer",
            "description": "The connection ID that the data request is using"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "DELETE",
              "PATCH"
            ],
            "description": "The HTTP method to use for the data request"
          },
          "route": {
            "type": "string",
            "description": "The route to use for the data request - API, RealtimeDB, Customer.io"
          },
          "headers": {
            "type": "array",
            "description": "The headers to use for the API data request",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "body": {
            "type": "string",
            "description": "The body to use for the API data request"
          },
          "useGlobalHeaders": {
            "type": "boolean",
            "default": true,
            "description": "Whether to use global headers for the API data request"
          },
          "query": {
            "type": "string",
            "description": "The query to use for the data request"
          },
          "pagination": {
            "type": "boolean",
            "default": false,
            "description": "Whether to use pagination for the API data request"
          },
          "itemsLimit": {
            "type": "integer",
            "default": 0,
            "description": "The items limit to use for the API data request. Used for pagination"
          },
          "offset": {
            "type": "string",
            "default": "offset",
            "description": "The offset to use for the API data request. Used for pagination"
          },
          "paginationField": {
            "type": "string",
            "description": "The pagination field to use for the API data request. Used for pagination"
          },
          "template": {
            "type": "string",
            "description": "The pagination template to use for API requests"
          },
          "conditions": {
            "type": "array",
            "description": "Conditions to apply to the data request - used for filtering Customer.io and Firestore",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "operator": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "configuration": {
            "$ref": "#/components/schemas/DataRequestConfiguration"
          },
          "transform": {
            "type": "object",
            "description": "Transformation to apply to the data request",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Whether to enable the transformation"
              },
              "type": {
                "type": "string",
                "description": "The type of transformation to apply (e.g., flattenNested)"
              },
              "configuration": {
                "type": "object",
                "description": "The configuration for the transformation",
                "additionalProperties": true
              }
            }
          },
          "variableBindings": {
            "type": "array",
            "description": "Variable bindings for the data request. The entity_type and entity_id will be automatically set.",
            "items": {
              "$ref": "#/components/schemas/NewVariableBinding"
            }
          }
        }
      },
      "DataRequestResponse": {
        "type": "object",
        "properties": {
          "options": {
            "$ref": "#/components/schemas/Dataset"
          },
          "dataRequest": {
            "type": "object",
            "properties": {
              "responseData": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "array",
                    "description": "Limited to first 20 items in response",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "configuration": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        }
      },
      "VariableBinding": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "entity_type": {
            "type": "string",
            "enum": [
              "Project",
              "Connection",
              "Dataset",
              "DataRequest",
              "Template"
            ]
          },
          "entity_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "default_value": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Dashboard": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "team_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "brewName": {
            "type": "string"
          },
          "dashboardTitle": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "backgroundColor": {
            "type": "string",
            "default": "#103751"
          },
          "titleColor": {
            "type": "string",
            "default": "white"
          },
          "headerCode": {
            "type": "string"
          },
          "footerCode": {
            "type": "string"
          },
          "logo": {
            "type": "string"
          },
          "logoLink": {
            "type": "string"
          },
          "public": {
            "type": "boolean",
            "default": false
          },
          "passwordProtected": {
            "type": "boolean",
            "default": false
          },
          "timezone": {
            "type": "string"
          },
          "updateSchedule": {
            "type": "object",
            "properties": {
              "timezone": {
                "type": "string",
                "example": "Asia/Bangkok"
              },
              "frequency": {
                "type": "string",
                "example": "every_x_minutes",
                "enum": [
                  "every_x_minutes",
                  "every_x_hours",
                  "every_x_days",
                  "daily",
                  "weekly"
                ]
              },
              "frequencyNumber": {
                "type": "string",
                "example": "1"
              },
              "time": {
                "type": "object",
                "properties": {
                  "hour": {
                    "type": "integer",
                    "example": 9
                  },
                  "minute": {
                    "type": "integer",
                    "example": 0
                  },
                  "second": {
                    "type": "integer",
                    "example": 0
                  },
                  "millisecond": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          },
          "lastUpdatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "Charts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Chart"
            }
          }
        }
      },
      "DashboardItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "dashboardTitle": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "team_id": {
            "type": "integer"
          },
          "brewName": {
            "type": "string"
          },
          "backgroundColor": {
            "type": "string"
          },
          "titleColor": {
            "type": "string"
          },
          "headerCode": {
            "type": "string"
          },
          "footerCode": {
            "type": "string"
          },
          "public": {
            "type": "boolean",
            "default": false
          },
          "password": {
            "type": "string"
          },
          "autoUpdate": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "default": false
              },
              "type": {
                "type": "string",
                "enum": [
                  "every_x_minutes",
                  "every_x_hours",
                  "every_x_days",
                  "daily",
                  "weekly"
                ]
              },
              "frequencyNumber": {
                "type": "string",
                "example": "1"
              },
              "time": {
                "type": "object",
                "properties": {
                  "hour": {
                    "type": "integer",
                    "example": 9
                  },
                  "minute": {
                    "type": "integer",
                    "example": 0
                  },
                  "second": {
                    "type": "integer",
                    "example": 0
                  },
                  "millisecond": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          },
          "lastUpdatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "Charts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "layout": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "NewDashboard": {
        "type": "object",
        "required": [
          "name",
          "team_id"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "team_id": {
            "type": "integer"
          },
          "dashboardTitle": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "DashboardUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "dashboardTitle": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "backgroundColor": {
            "type": "string"
          },
          "titleColor": {
            "type": "string"
          },
          "headerCode": {
            "type": "string"
          },
          "footerCode": {
            "type": "string"
          },
          "public": {
            "type": "boolean"
          },
          "passwordProtected": {
            "type": "boolean"
          },
          "timezone": {
            "type": "string"
          },
          "updateSchedule": {
            "type": "object",
            "properties": {
              "timezone": {
                "type": "string",
                "example": "Asia/Bangkok"
              },
              "frequency": {
                "type": "string",
                "example": "every_x_minutes",
                "enum": [
                  "every_x_minutes",
                  "every_x_hours",
                  "every_x_days",
                  "daily",
                  "weekly"
                ]
              },
              "frequencyNumber": {
                "type": "string",
                "example": "1"
              },
              "time": {
                "type": "object",
                "properties": {
                  "hour": {
                    "type": "integer",
                    "example": 9
                  },
                  "minute": {
                    "type": "integer",
                    "example": 0
                  },
                  "second": {
                    "type": "integer",
                    "example": 0
                  },
                  "millisecond": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      },
      "Chart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "line",
              "bar",
              "pie",
              "doughnut",
              "radar",
              "polar",
              "table",
              "kpi",
              "avg",
              "gauge",
              "matrix",
              "markdown"
            ]
          },
          "subType": {
            "type": "string"
          },
          "chartData": {
            "type": "object"
          },
          "chartDataUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "project_id": {
            "type": "string"
          },
          "public": {
            "type": "boolean"
          },
          "shareable": {
            "type": "boolean"
          },
          "ChartDatasetConfigs": {
            "type": "array",
            "items": {
              "type": "object",
              "$ref": "#/components/schemas/ChartDatasetConfig"
            }
          }
        }
      },
      "NewChart": {
        "type": "object",
        "required": [
          "name",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "subType": {
            "type": "string"
          },
          "chartData": {
            "type": "object"
          },
          "chartDataUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "project_id": {
            "type": "string"
          },
          "public": {
            "type": "boolean"
          },
          "shareable": {
            "type": "boolean"
          },
          "ChartDatasetConfigs": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "ChartUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "subType": {
            "type": "string"
          },
          "chartData": {
            "type": "object"
          },
          "ChartDatasetConfigs": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "ChartDatasetConfig": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "chart_id": {
            "type": "integer"
          },
          "dataset_id": {
            "type": "integer"
          },
          "xAxis": {
            "type": "string",
            "description": "Chart-specific x-axis or dimension field using traversal syntax - root[].field"
          },
          "xAxisOperation": {
            "type": "string",
            "description": "Chart-specific x-axis operation"
          },
          "yAxis": {
            "type": "string",
            "description": "Chart-specific y-axis or metric field using traversal syntax - root[].field"
          },
          "yAxisOperation": {
            "type": "string",
            "description": "Chart-specific operation to perform on the y-axis - none, sum, avg, min, max, count"
          },
          "dateField": {
            "type": "string",
            "description": "Chart-specific date field using traversal syntax. Specifies which field should be used for date filtering."
          },
          "dateFormat": {
            "type": "string",
            "description": "Chart-specific date format to use for date filtering. e.g YYYY-MM-DD"
          },
          "conditions": {
            "type": "array",
            "description": "Chart-specific conditions layered on top of the dataset",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "field": {
                  "type": "string",
                  "description": "Field using traversal syntax - root[].field"
                },
                "operator": {
                  "type": "string",
                  "enum": [
                    "is",
                    "isNot",
                    "greaterThan",
                    "lessThan",
                    "greaterThanOrEqual",
                    "lessThanOrEqual",
                    "contains",
                    "notContains",
                    "isNull",
                    "isNotNull"
                  ],
                  "description": "Comparison operator"
                },
                "value": {
                  "type": "string"
                },
                "displayValues": {
                  "type": "boolean",
                  "description": "Whether to display the values in the dropdown UI"
                }
              }
            }
          },
          "formula": {
            "type": "string"
          },
          "datasetColor": {
            "type": "string"
          },
          "fillColor": {
            "type": "string"
          },
          "fill": {
            "type": "boolean",
            "default": false
          },
          "multiFill": {
            "type": "boolean",
            "default": false
          },
          "legend": {
            "type": "string"
          },
          "pointRadius": {
            "type": "integer"
          },
          "excludedFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "type": "string"
          },
          "columnsOrder": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "order": {
            "type": "integer",
            "default": 0
          },
          "maxRecords": {
            "type": "integer"
          },
          "goal": {
            "type": "integer"
          },
          "configuration": {
            "type": "object",
            "description": "Additional configuration options for the dataset. Currently used to give values to variables.",
            "properties": {
              "variables": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Variable name from DataRequest VariableBinding"
                    },
                    "value": {
                      "description": "Override value (string, number, etc.)",
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "QuickNewChartDatasetConfig": {
        "type": "object",
        "description": "Chart dataset config to create. chart_id is automatically set. Per-chart bindings such as xAxis, yAxis, dateField, and conditions belong here.",
        "required": [
          "dataset_id"
        ],
        "properties": {
          "dataset_id": {
            "type": "integer",
            "description": "ID of the dataset to bind to the chart"
          },
          "xAxis": {
            "type": "string",
            "description": "Chart-specific x-axis or dimension field using traversal syntax - root[].field"
          },
          "xAxisOperation": {
            "type": "string",
            "description": "Chart-specific x-axis operation"
          },
          "yAxis": {
            "type": "string",
            "description": "Chart-specific y-axis or metric field using traversal syntax - root[].field"
          },
          "yAxisOperation": {
            "type": "string",
            "description": "Chart-specific operation to perform on the y-axis - none, sum, avg, min, max, count",
            "enum": [
              "none",
              "count",
              "count_unique",
              "sum",
              "avg",
              "min",
              "max"
            ]
          },
          "dateField": {
            "type": "string",
            "description": "Chart-specific date field using traversal syntax. Specifies which field should be used for date filtering."
          },
          "dateFormat": {
            "type": "string",
            "description": "Chart-specific date format to use for date filtering. e.g YYYY-MM-DD"
          },
          "conditions": {
            "type": "array",
            "description": "Chart-specific conditions layered on top of the dataset",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "field": {
                  "type": "string",
                  "description": "Field using traversal syntax - root[].field"
                },
                "operator": {
                  "type": "string",
                  "enum": [
                    "is",
                    "isNot",
                    "greaterThan",
                    "lessThan",
                    "greaterThanOrEqual",
                    "lessThanOrEqual",
                    "contains",
                    "notContains",
                    "isNull",
                    "isNotNull"
                  ],
                  "description": "Comparison operator"
                },
                "value": {
                  "type": "string"
                },
                "displayValues": {
                  "type": "boolean",
                  "description": "Whether to display the values in the dropdown UI"
                }
              }
            }
          },
          "formula": {
            "type": "string",
            "description": "The formula (e.g {val / 100}) used to transform the data points values. Can be used to pre-(a)pend strings to numbers too £{val}"
          },
          "datasetColor": {
            "type": "string",
            "description": "The color of the dataset"
          },
          "fillColor": {
            "type": "string",
            "description": "The color of the dataset fill"
          },
          "fill": {
            "type": "boolean",
            "default": false,
            "description": "Whether to fill the dataset"
          },
          "multiFill": {
            "type": "boolean",
            "default": false,
            "description": "Useful for the UI to prompt the user to select multiple colors for the dataset"
          },
          "legend": {
            "type": "string",
            "description": "The chart-specific legend label for this dataset. If not provided, will fall back to the dataset name."
          },
          "pointRadius": {
            "type": "integer",
            "description": "Point radius for the dataset"
          },
          "excludedFields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The fields to exclude from the dataset - used for tables"
          },
          "sort": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ],
            "description": "The sort order of the dataset"
          },
          "columnsOrder": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The order of the columns in the dataset - used for tables"
          },
          "order": {
            "type": "number",
            "default": 1,
            "description": "The order of the dataset in the chart"
          },
          "maxRecords": {
            "type": "integer",
            "description": "The maximum number of records to display in the dataset"
          },
          "goal": {
            "type": "integer",
            "description": "The goal of the dataset - used to display a progress bar for KPIs"
          },
          "configuration": {
            "type": "object",
            "description": "Additional configuration options for the dataset. Currently used to give values to variables.",
            "properties": {
              "variables": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Variable name from DataRequest VariableBinding"
                    },
                    "value": {
                      "description": "Override value (string, number, etc.)",
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "QuickNewChart": {
        "type": "object",
        "required": [
          "project_id",
          "name",
          "type"
        ],
        "description": "Create a chart with all its chart dataset configs in one API call. Per-series bindings belong in each chartDatasetConfigs item.",
        "properties": {
          "project_id": {
            "type": "integer",
            "description": "ID of the project"
          },
          "name": {
            "type": "string",
            "description": "Name of the chart"
          },
          "type": {
            "type": "string",
            "description": "The type of chart",
            "enum": [
              "line",
              "bar",
              "pie",
              "doughnut",
              "radar",
              "polar",
              "table",
              "kpi",
              "avg",
              "gauge",
              "matrix",
              "markdown"
            ]
          },
          "subType": {
            "type": "string",
            "description": "The sub-type of chart, currently only AddTimeseries is supported for accumulating timeseries data"
          },
          "public": {
            "type": "boolean",
            "default": false,
            "description": "Whether the chart is public"
          },
          "shareable": {
            "type": "boolean",
            "default": false,
            "description": "Whether the chart is shareable"
          },
          "displayLegend": {
            "type": "boolean",
            "default": false,
            "description": "Whether to display the chart.js legend"
          },
          "pointRadius": {
            "type": "integer",
            "description": "0 to hide, integer value to set the point radius"
          },
          "dataLabels": {
            "type": "boolean",
            "default": false,
            "description": "Whether to display the data labels on each data point on the chart"
          },
          "startDate": {
            "type": "string",
            "format": "date-time",
            "description": "Used to inject a fixed start date into the chart"
          },
          "endDate": {
            "type": "string",
            "format": "date-time",
            "description": "Used to inject a fixed end date into the chart"
          },
          "dateVarsFormat": {
            "type": "string",
            "description": "The format of the date variables in the chart"
          },
          "includeZeros": {
            "type": "boolean",
            "default": true,
            "description": "Whether to include zero-valued data points in the chart"
          },
          "currentEndDate": {
            "type": "boolean",
            "default": false,
            "description": "Whether to use the current end date as the end date for the chart - this moves the start date to match the original period length"
          },
          "fixedStartDate": {
            "type": "boolean",
            "default": false,
            "description": "Whether to force the start date to remain fixed"
          },
          "timeInterval": {
            "type": "string",
            "default": "day",
            "enum": [
              "second",
              "minute",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "description": "The time interval of the chart"
          },
          "autoUpdate": {
            "type": "integer",
            "description": "The interval in seconds at which the chart should be automatically updated"
          },
          "draft": {
            "type": "boolean",
            "default": true,
            "description": "Whether the chart is a draft and should be hidden from dashboard viewers"
          },
          "mode": {
            "type": "string",
            "default": "chart",
            "enum": [
              "chart",
              "kpichart"
            ],
            "description": "Chart mode shows just the chart, kpichart shows a KPI on top of the chart."
          },
          "maxValue": {
            "type": "integer",
            "description": "Cap the maximum shown value on the chart"
          },
          "minValue": {
            "type": "integer",
            "description": "Cap the minimum shown value on the chart"
          },
          "disabledExport": {
            "type": "boolean",
            "description": "Whether to disable the export button for the chart"
          },
          "onReport": {
            "type": "boolean",
            "default": true,
            "description": "Whether to display the chart on the report"
          },
          "xLabelTicks": {
            "type": "string",
            "default": "default",
            "enum": [
              "default",
              "half",
              "third",
              "fourth",
              "showAll"
            ],
            "description": "How many ticks to display on the x-axis"
          },
          "stacked": {
            "type": "boolean",
            "default": false,
            "description": "Whether to stack the chart - only works for bar charts"
          },
          "horizontal": {
            "type": "boolean",
            "default": false,
            "description": "Whether to display the chart horizontally - only works for bar charts"
          },
          "showGrowth": {
            "type": "boolean",
            "default": false,
            "description": "Whether to show the growth percentage at the top of the chart"
          },
          "invertGrowth": {
            "type": "boolean",
            "default": false,
            "description": "When negative growth is meant to be positive and vice versa"
          },
          "layout": {
            "type": "object",
            "description": "The layout of the chart - in the format of react-grid-layout. If not provided, will be automatically calculated based on existing charts in the project.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "number"
              }
            }
          },
          "isLogarithmic": {
            "type": "boolean",
            "default": false,
            "description": "Whether to use a logarithmic scale for the y-axis"
          },
          "content": {
            "type": "string",
            "description": "The content used for type=markdown"
          },
          "ranges": {
            "type": "object",
            "description": "The ranges to display on the chart - only works for gauge charts",
            "properties": {
              "ranges": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "min": {
                      "type": "number"
                    },
                    "max": {
                      "type": "number"
                    },
                    "label": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "dashedLastPoint": {
            "type": "boolean",
            "default": false,
            "description": "Whether to dash the last point on the chart - only works for line charts"
          },
          "defaultRowsPerPage": {
            "type": "integer",
            "default": 10,
            "description": "Default number of rows per page for table charts"
          },
          "chartDatasetConfigs": {
            "type": "array",
            "description": "Array of chart dataset configs to create with the chart. The chart_id will be automatically set.",
            "items": {
              "type": "object",
              "$ref": "#/components/schemas/QuickNewChartDatasetConfig"
            }
          }
        }
      },
      "SharePolicy": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "entity_type": {
            "type": "string",
            "enum": [
              "Project",
              "Chart"
            ]
          },
          "entity_id": {
            "type": "integer"
          },
          "params": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            },
            "description": "Parameters to pass to variables in the dashboard's charts"
          },
          "allow_params": {
            "type": "boolean",
            "default": false,
            "description": "Whether to allow parameters to be passed via URL"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SharePolicyUpdate": {
        "type": "object",
        "properties": {
          "params": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            },
            "description": "Parameters to include in the share policy. Use this to pass parameters to the dashboard's variables."
          },
          "allow_params": {
            "type": "boolean",
            "default": false,
            "description": "Whether to allow parameters to be passed via URL"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Token expiration date and time"
          }
        }
      },
      "ShareTokenRequest": {
        "type": "object",
        "properties": {
          "share_policy": {
            "type": "object",
            "properties": {
              "params": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  }
                },
                "description": "Parameters to include in the share policy"
              },
              "allow_params": {
                "type": "boolean",
                "description": "Whether to allow URL parameters"
              }
            }
          },
          "exp": {
            "type": "string",
            "format": "date-time",
            "description": "Token expiration date and time"
          }
        }
      },
      "ShareTokenResponse": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "The generated JWT access token"
          },
          "url": {
            "type": "string",
            "description": "The complete URL with access token for sharing"
          }
        }
      },
      "ChartShareTokenRequest": {
        "type": "object",
        "properties": {
          "share_policy": {
            "type": "object",
            "properties": {
              "params": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  }
                },
                "description": "Parameters to include in the chart share policy"
              },
              "allow_params": {
                "type": "boolean",
                "description": "Whether to allow URL parameters for the chart"
              }
            }
          },
          "exp": {
            "type": "string",
            "format": "date-time",
            "description": "Token expiration date and time for the chart"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}