{
  "components": {
    "schemas": {
      "matviews.MatviewListElement": {
        "properties": {
          "id": {
            "type": "string"
          },
          "is_private": {
            "type": "boolean"
          },
          "query_id": {
            "type": "integer"
          },
          "sql_id": {
            "type": "string"
          },
          "table_size_bytes": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "matviews.MatviewSchedule": {
        "properties": {
          "cron_expression": {
            "example": "0 */6 * * *",
            "type": "string"
          },
          "expires_at": {
            "example": "2026-09-11T23:59:59Z",
            "type": "string"
          },
          "next_execution_time": {
            "example": "2026-06-12T00:00:00Z",
            "type": "string"
          },
          "performance": {
            "example": "medium",
            "type": "string"
          }
        },
        "type": "object"
      },
      "matviews.MatviewsDeleteResponse": {
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "matviews.MatviewsGetResponse": {
        "properties": {
          "id": {
            "type": "string"
          },
          "is_private": {
            "type": "boolean"
          },
          "last_execution_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "owner_team_id": {
            "type": "integer"
          },
          "owner_user_id": {
            "type": "integer"
          },
          "query_id": {
            "type": "integer"
          },
          "schedule": {
            "$ref": "#/components/schemas/matviews.MatviewSchedule"
          },
          "sql_id": {
            "type": "string"
          },
          "table_size_bytes": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "matviews.MatviewsListResponse": {
        "properties": {
          "materialized_views": {
            "items": {
              "$ref": "#/components/schemas/matviews.MatviewListElement"
            },
            "type": "array"
          },
          "next_offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "matviews.MatviewsRefreshRequest": {
        "properties": {
          "performance": {
            "description": "Performance tier for the refresh execution. Accepts `small`, `medium`, `large`.\nOmit to use the default tier for the source query's engine.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "matviews.MatviewsRefreshResponse": {
        "properties": {
          "execution_id": {
            "description": "Unique identifier for the execution triggered to refresh the materialized view",
            "example": "01HZ065JVE23C23FM2HKWQP2RT",
            "type": "string"
          },
          "sql_id": {
            "description": "Unique identifier for the materialized view",
            "example": "dune.dune.result_erc_20_token_summary",
            "type": "string"
          }
        },
        "type": "object"
      },
      "matviews.MatviewsUpsertRequest": {
        "properties": {
          "cron_expression": {
            "type": "string"
          },
          "expires_at": {
            "type": "string"
          },
          "is_private": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "performance": {
            "description": "Performance tier for the refresh execution. Accepts `small`, `medium`, `large`.\nOmit to use the default tier for the source query's engine.",
            "type": "string"
          },
          "query_id": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "matviews.MatviewsUpsertResponse": {
        "properties": {
          "execution_id": {
            "description": "Unique identifier for the execution triggered to refresh the materialized view",
            "example": "01HZ065JVE23C23FM2HKWQP2RT",
            "type": "string"
          },
          "name": {
            "description": "Unique identifier for the materialized view",
            "example": "dune.dune.result_erc_20_token_summary",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.ArchiveDashboardCrudResponse": {
        "properties": {
          "dashboard_id": {
            "type": "integer"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "models.BillingPeriod": {
        "properties": {
          "credits_included": {
            "description": "Float value",
            "type": "number"
          },
          "credits_used": {
            "description": "Float value",
            "type": "number"
          },
          "end_date": {
            "description": "YYYY-MM-DD format",
            "type": "string"
          },
          "start_date": {
            "description": "YYYY-MM-DD format",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.CSVUploadRequest": {
        "properties": {
          "data": {
            "description": "The data to be uploaded in CSV format.",
            "type": "string"
          },
          "description": {
            "description": "Description of the upload.",
            "type": "string"
          },
          "is_private": {
            "description": "Indicates if the upload is private.",
            "type": "boolean"
          },
          "table_name": {
            "description": "The name of the table to store the data.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.CSVUploadResponse": {
        "properties": {
          "full_name": {
            "description": "the full name of the table that was created",
            "example": "dune.my_team.dataset_ten_year_us_interest_rates",
            "type": "string"
          },
          "success": {
            "description": "Indicator if the request was successful",
            "type": "boolean"
          },
          "table_name": {
            "description": "The name of the table that was created",
            "example": "ten_year_us_interest_rates",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.CancelQueryExecutionResponse": {
        "properties": {
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "models.CreateDashboardCrudRequest": {
        "properties": {
          "columns_per_row": {
            "type": "integer"
          },
          "is_private": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "text_widgets": {
            "items": {
              "$ref": "#/components/schemas/models.TextWidgetInput"
            },
            "type": "array"
          },
          "visualization_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "models.CreateQueryRequest": {
        "properties": {
          "description": {
            "description": "The description of the created query.",
            "type": "string"
          },
          "is_private": {
            "description": "Indicates if the query is private, meaning that only the\nteam or, in case of personal queries, the user that created it can see it.",
            "example": true,
            "type": "boolean"
          },
          "is_temp": {
            "description": "Indicates if the query is temporary (unsaved).\nTemporary queries can be executed but won't appear in the library.",
            "example": false,
            "type": "boolean"
          },
          "name": {
            "description": "The name of the created query.",
            "type": "string"
          },
          "parameters": {
            "description": "The parameters that the SQL query accepts.",
            "items": {
              "$ref": "#/components/schemas/models.Parameter"
            },
            "type": "array"
          },
          "query_sql": {
            "description": "The SQL of the query.",
            "type": "string"
          },
          "tags": {
            "description": "The tags of the query.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "name",
          "query_sql"
        ],
        "type": "object"
      },
      "models.CreateQueryResponse": {
        "properties": {
          "query_id": {
            "description": "The Unique ID of the created query",
            "example": 1,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.CreateVisualizationRequest": {
        "properties": {
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "options": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "type"
        ],
        "type": "object"
      },
      "models.CreateVisualizationResponse": {
        "properties": {
          "id": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.DashboardCrudResponse": {
        "properties": {
          "dashboard_id": {
            "type": "integer"
          },
          "dashboard_url": {
            "type": "string"
          },
          "is_private": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "param_widgets": {
            "items": {
              "$ref": "#/components/schemas/models.ParamWidgetOutput"
            },
            "type": "array"
          },
          "slug": {
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "text_widgets": {
            "items": {
              "$ref": "#/components/schemas/models.TextWidgetOutput"
            },
            "type": "array"
          },
          "visualization_widgets": {
            "items": {
              "$ref": "#/components/schemas/models.VisualizationWidgetOutput"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "models.DatasetColumn": {
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/models.DatasetColumnMetadata"
          },
          "name": {
            "type": "string"
          },
          "nullable": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.DatasetColumnMetadata": {
        "properties": {
          "description": {
            "type": "string"
          },
          "filtering_column": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "models.DatasetOwner": {
        "properties": {
          "handle": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.DatasetResponse": {
        "properties": {
          "columns": {
            "items": {
              "$ref": "#/components/schemas/models.DatasetColumn"
            },
            "type": "array"
          },
          "created_at": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "is_private": {
            "type": "boolean"
          },
          "metadata": {},
          "owner": {
            "$ref": "#/components/schemas/models.DatasetOwner"
          },
          "type": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.DeleteVisualizationResponse": {
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "models.EnumFromResults": {
        "properties": {
          "columnName": {
            "type": "string"
          },
          "queryId": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.Error400": {
        "properties": {
          "error": {
            "example": "Bad Request",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.Error401": {
        "properties": {
          "error": {
            "example": "Invalid API Key",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.Error402": {
        "properties": {
          "error": {
            "example": "This API request would exceed your configured limits per billing cycle.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.Error403": {
        "properties": {
          "error": {
            "example": "Not allowed to execute query. Query is archived, unsaved or not enough permissions",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.Error404": {
        "properties": {
          "error": {
            "example": "Object not found",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.Error500": {
        "properties": {
          "error": {
            "example": "Internal error",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.ExecutePipelineRequest": {
        "properties": {
          "pipeline": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.Pipeline"
              }
            ],
            "description": "The pipeline definition containing nodes to execute"
          }
        },
        "type": "object"
      },
      "models.ExecutePipelineResponse": {
        "properties": {
          "pipeline_execution_id": {
            "description": "Unique identifier for the pipeline execution. Use this ID to check the status\nand retrieve results of the pipeline execution.",
            "example": "01HKZJ2683PHF9Q9PHHQ8FW4Q1",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.ExecuteQueryPipelineRequest": {
        "properties": {
          "performance": {
            "enum": [
              "small",
              "medium",
              "large"
            ],
            "type": "string"
          },
          "query_parameters": {
            "description": "SQL Query parameters in json key-value pairs. Each parameter is to be provided in key-value pairs. This enables you to execute a parameterized query with the provided values for your parameter keys.",
            "type": "object"
          }
        },
        "required": [
          "performance"
        ],
        "type": "object"
      },
      "models.ExecuteQueryPipelineResponse": {
        "properties": {
          "pipeline_execution_id": {
            "description": "Unique identifier for the pipeline execution. Use this ID to check the status\nand retrieve results of the pipeline execution.",
            "example": "01HKZJ2683PHF9Q9PHHQ8FW4Q1",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.ExecuteQueryResponse": {
        "properties": {
          "execution_id": {
            "example": "01HKZJ2683PHF9Q9PHHQ8FW4Q1",
            "type": "string"
          },
          "state": {
            "example": "QUERY_STATE_PENDING",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.ExecuteSQLRequest": {
        "properties": {
          "performance": {
            "description": "The performance engine tier the execution will be run on",
            "enum": [
              "small",
              "medium",
              "large"
            ],
            "type": "string"
          },
          "sql": {
            "description": "The SQL query to execute",
            "type": "string"
          }
        },
        "required": [
          "sql"
        ],
        "type": "object"
      },
      "models.ExecutionResultMetadata": {
        "properties": {
          "column_names": {
            "description": "Names of the columns in the result set.",
            "example": [
              "Rank",
              "Project",
              "Volume"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "column_types": {
            "description": "Types of the columns in the result set.",
            "example": [
              "double",
              "varchar",
              "bigint"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "datapoint_count": {
            "description": "Results cell count is used for billing/pricing plans\nhere we expose the these values to the user, so that they can track their costs",
            "example": 1000,
            "type": "integer"
          },
          "execution_time_millis": {
            "description": "Time in milliseconds that the query took to execute.",
            "example": 1000,
            "type": "integer"
          },
          "pending_time_millis": {
            "description": "Time in milliseconds that the query was pending before execution.",
            "example": 1000,
            "type": "integer"
          },
          "result_set_bytes": {
            "description": "ResultSetBytes represents the raw data bytes returned by the SQL execution engine, it includes:\n + total nr of bytes used on 1 line with all the column names (the header of the result set)\n + total nr of bytes for all the row values (the result set of rows)\n\nit doesn't include overheads such as the presence of column names for every row in the JSON result type.\nit also doesn't include opmitizations such as compression",
            "example": 1000,
            "type": "integer"
          },
          "row_count": {
            "description": "Number of rows in the result set for the current page of results.",
            "example": 10,
            "type": "integer"
          },
          "total_result_set_bytes": {
            "description": "Total number of bytes in the result set. This doesn't include the json representation overhead.",
            "example": 10000,
            "type": "integer"
          },
          "total_row_count": {
            "description": "Number of rows in the result set for the entire result set.",
            "example": 1000,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.GetExecutionStatusResponse": {
        "properties": {
          "cancelled_at": {
            "description": "Timestamp of when the query execution was cancelled, if applicable.",
            "example": "2024-12-20T11:04:18.724658237Z",
            "type": "string"
          },
          "error": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.QueryResultError"
              }
            ],
            "description": "In case the execution had an error, this object will contain the error details"
          },
          "execution_cost_credits": {
            "description": "Cost of the execution",
            "type": "number"
          },
          "execution_ended_at": {
            "description": "Timestamp of when the query execution ended.",
            "example": "2024-12-20T11:04:18.724658237Z",
            "type": "string"
          },
          "execution_id": {
            "description": "Unique identifier for the execution of the query and corresponding result.",
            "example": "01HKZJ2683PHF9Q9PHHQ8FW4Q1",
            "type": "string"
          },
          "execution_started_at": {
            "description": "Timestamp of when the query execution started.",
            "example": "2024-12-20T11:04:18.724658237Z",
            "type": "string"
          },
          "expires_at": {
            "description": "Timestamp of when the query result expires.",
            "example": "2024-12-20T11:04:18.724658237Z",
            "type": "string"
          },
          "is_execution_finished": {
            "description": "Whether the state of the query execution is terminal. This can be used for polling purposes.",
            "example": true,
            "type": "boolean"
          },
          "max_inflight_interactive_executions": {
            "description": "Number of interactive executions this customer can have running in parallel",
            "example": 3,
            "type": "integer"
          },
          "max_inflight_interactive_reached": {
            "description": "Total number of interactive executions this user has submitted which are still in progress\nonly set to \u003e 0 if the user has reached the limit of concurrent interactive executions",
            "example": 5,
            "type": "integer"
          },
          "query_id": {
            "description": "Unique identifier of the query.",
            "example": 1234,
            "type": "integer"
          },
          "queue_position": {
            "example": 1,
            "type": "integer"
          },
          "result_metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.ExecutionResultMetadata"
              }
            ],
            "description": "Metadata about the execution of the query, including details like column names, row counts, and execution times."
          },
          "state": {
            "description": "The state of the query execution.",
            "example": "QUERY_STATE_COMPLETED",
            "type": "string"
          },
          "submitted_at": {
            "description": "Timestamp of when the query was submitted.",
            "example": "2024-12-20T11:04:18.724658237Z",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.GetPipelineExecutionStatusResponse": {
        "properties": {
          "error": {
            "description": "Error message if the pipeline execution failed",
            "type": "string"
          },
          "node_executions": {
            "description": "List of node executions in the pipeline.",
            "items": {
              "$ref": "#/components/schemas/models.PipelineNodeExecution"
            },
            "type": "array"
          },
          "status": {
            "description": "Overall status of the pipeline execution",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.GetQueryPipelineResponse": {
        "properties": {
          "pipeline": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.Pipeline"
              }
            ],
            "description": "The pipeline definition containing nodes to execute"
          }
        },
        "type": "object"
      },
      "models.GetQueryResponse": {
        "properties": {
          "contributors": {
            "description": "Contributors to the query (users who have created or saved it).\nOnly included when include_contributors=true query parameter is set.",
            "items": {
              "$ref": "#/components/schemas/models.QueryContributor"
            },
            "type": "array"
          },
          "description": {
            "description": "The description of the query",
            "example": "Calculate the average dex volume",
            "type": "string"
          },
          "is_archived": {
            "description": "Indicates if the query is archived.\nArchived queries cannot be executed.",
            "example": false,
            "type": "boolean"
          },
          "is_private": {
            "description": "Indicates if the query is private.",
            "example": true,
            "type": "boolean"
          },
          "is_temp": {
            "description": "Indicates if the query is temporary (unsaved).",
            "example": false,
            "type": "boolean"
          },
          "is_unsaved": {
            "description": "Indicates if the query is unsaved (legacy name).",
            "example": false,
            "type": "boolean"
          },
          "name": {
            "description": "The name of the query",
            "example": "My Query",
            "type": "string"
          },
          "owner": {
            "description": "username or team handle",
            "example": "dune",
            "type": "string"
          },
          "parameters": {
            "description": "The parameters that can modify the execution of the sql.",
            "items": {
              "$ref": "#/components/schemas/models.Parameter"
            },
            "type": "array"
          },
          "query_engine": {
            "description": "The query engine used to execute the query.",
            "example": "medium",
            "type": "string"
          },
          "query_id": {
            "description": "The unique ID of the query",
            "example": 123,
            "type": "integer"
          },
          "query_sql": {
            "description": "The SQL query text.",
            "example": "SELECT * FROM dex.trades",
            "type": "string"
          },
          "tags": {
            "description": "Tags associated with the query.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "version": {
            "description": "Version of the query, gets incremented every time the query is updated.",
            "example": 1,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.GetUsageRequest": {
        "properties": {
          "end_date": {
            "description": "Optional field in YYYY-MM-DD format",
            "type": "string"
          },
          "start_date": {
            "description": "Optional field in YYYY-MM-DD format",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.GetUsageResponse": {
        "properties": {
          "billing_periods": {
            "items": {
              "$ref": "#/components/schemas/models.BillingPeriod"
            },
            "type": "array"
          },
          "bytes_allowed": {
            "type": "integer"
          },
          "bytes_used": {
            "type": "integer"
          },
          "private_dashboards": {
            "type": "integer"
          },
          "private_queries": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.GetVisualizationResponse": {
        "properties": {
          "created_at": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "options": {
            "additionalProperties": {},
            "type": "object"
          },
          "query_id": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.ListDatasetsResponse": {
        "properties": {
          "datasets": {
            "items": {
              "$ref": "#/components/schemas/models.DatasetResponse"
            },
            "type": "array"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.ListQueriesResponse": {
        "properties": {
          "queries": {
            "description": "List of queries",
            "items": {
              "$ref": "#/components/schemas/models.ResolvedQueryOverview"
            },
            "type": "array"
          },
          "total": {
            "description": "Total number of queries available",
            "example": 100,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.ListVisualizationsResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/models.VisualizationSummary"
            },
            "type": "array"
          },
          "total_count": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.ParamWidgetInput": {
        "properties": {
          "key": {
            "type": "string"
          },
          "position": {
            "$ref": "#/components/schemas/models.WidgetPosition"
          },
          "query_id": {
            "type": "integer"
          },
          "visualization_widget_id": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.ParamWidgetOutput": {
        "properties": {
          "key": {
            "type": "string"
          },
          "position": {
            "$ref": "#/components/schemas/models.WidgetPosition"
          },
          "query_id": {
            "type": "integer"
          },
          "visualization_widget_id": {
            "type": "integer"
          },
          "widget_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.Parameter": {
        "properties": {
          "description": {
            "type": "string"
          },
          "enumFromResults": {
            "$ref": "#/components/schemas/models.EnumFromResults"
          },
          "enumOptions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "isFreeformAllowed": {
            "type": "boolean"
          },
          "isMultiselect": {
            "type": "boolean"
          },
          "key": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "values": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "models.Pipeline": {
        "properties": {
          "nodes": {
            "description": "List of nodes in the pipeline. Nodes are executed in dependency order.",
            "items": {
              "$ref": "#/components/schemas/models.PipelineNode"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "models.PipelineMaterializedViewRefreshNode": {
        "properties": {
          "name": {
            "description": "Name of the materialized view to refresh",
            "example": "mv_1",
            "type": "string"
          },
          "performance": {
            "description": "The performance engine tier the refresh will be run on. Can be `small`, `medium`, or `large`.",
            "enum": [
              "small",
              "medium",
              "large"
            ],
            "example": "medium",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.PipelineMaterializedViewRefreshStatus": {
        "properties": {
          "error": {
            "description": "Error message if the refresh failed",
            "type": "string"
          },
          "execution_id": {
            "description": "Unique identifier of the execution, if available",
            "type": "string"
          },
          "name": {
            "description": "Name of the materialized view",
            "type": "string"
          },
          "status": {
            "description": "Status of the materialized view refresh",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.PipelineNode": {
        "properties": {
          "dependencies": {
            "description": "List of node IDs that this node depends on. Nodes are executed in dependency order.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "id": {
            "description": "Unique identifier of the node in the pipeline",
            "example": 1,
            "type": "integer"
          },
          "materialized_view_refresh": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.PipelineMaterializedViewRefreshNode"
              }
            ],
            "description": "Materialized view refresh node configuration. Required if this node refreshes a materialized view."
          },
          "query_execution": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.PipelineQueryExecutionNode"
              }
            ],
            "description": "Query execution node configuration. Required if this node executes a query."
          }
        },
        "type": "object"
      },
      "models.PipelineNodeExecution": {
        "properties": {
          "id": {
            "description": "Unique identifier of the node in the pipeline",
            "type": "integer"
          },
          "materialized_view_refresh_status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.PipelineMaterializedViewRefreshStatus"
              }
            ],
            "description": "Status of the materialized view refresh, if this node is a materialized view refresh node"
          },
          "query_execution_status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.PipelineQueryExecutionStatus"
              }
            ],
            "description": "Status of the query execution, if this node is a query execution node"
          }
        },
        "type": "object"
      },
      "models.PipelineQueryExecutionNode": {
        "properties": {
          "performance": {
            "description": "The performance engine tier the execution will be run on. Can be `small`, `medium`, or `large`.",
            "enum": [
              "small",
              "medium",
              "large"
            ],
            "example": "medium",
            "type": "string"
          },
          "query_id": {
            "description": "Unique identifier of the query to execute",
            "example": 1234,
            "type": "integer"
          },
          "query_parameters": {
            "description": "SQL Query parameters in json key-value pairs. Each parameter is to be provided in key-value pairs. This enables you to execute a parameterized query with the provided values for your parameter keys.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "models.PipelineQueryExecutionStatus": {
        "properties": {
          "error": {
            "description": "Error message, if the execution failed",
            "type": "string"
          },
          "execution_id": {
            "description": "Unique identifier of the execution, if available",
            "type": "string"
          },
          "query_id": {
            "description": "Unique identifier of the query",
            "type": "integer"
          },
          "status": {
            "description": "Status of the query execution",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.QueryContributor": {
        "properties": {
          "contribution_count": {
            "description": "The number of contributions this user made to the query",
            "example": 5,
            "type": "integer"
          },
          "handle": {
            "description": "The handle (username) of the contributor",
            "example": "wizardofdefi",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.QueryResultData": {
        "properties": {
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.ExecutionResultMetadata"
              }
            ],
            "description": "Metadata about the execution of the query, including details like column names,\nrow counts, and execution times."
          },
          "rows": {
            "description": "A list of rows. A row is dictionary of key-value pairs returned by the query,\neach pair corresponding to a column",
            "items": {
              "$ref": "#/components/schemas/models.Row"
            },
            "type": "array"
          },
          "update_type": {
            "description": "The type of update operation from Trino (e.g., \"SET SESSION\")",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.QueryResultError": {
        "properties": {
          "message": {
            "description": "A descriptive message about the error.",
            "example": "Error: Line 1:1: mismatched input 'selecdt'",
            "type": "string"
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.SyntaxErrorMetadata"
              }
            ],
            "description": "Metadata about the syntax error that occurred, if applicable."
          },
          "type": {
            "description": "The type of error that occurred.",
            "example": "syntax_error",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.ReadExecutionResultResponse": {
        "properties": {
          "cancelled_at": {
            "description": "Timestamp of when the query execution was cancelled, if applicable.",
            "example": "2024-12-20T11:04:18.724658237Z",
            "type": "string"
          },
          "error": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.QueryResultError"
              }
            ],
            "description": "In case the execution had an error, this object will contain the error details"
          },
          "execution_ended_at": {
            "description": "Timestamp of when the query execution ended.",
            "example": "2024-12-20T11:04:18.724658237Z",
            "type": "string"
          },
          "execution_id": {
            "description": "Unique identifier for the execution of the query.",
            "example": "01HKZJ2683PHF9Q9PHHQ8FW4Q1",
            "type": "string"
          },
          "execution_started_at": {
            "description": "Timestamp of when the query execution started.",
            "example": "2024-12-20T11:04:18.724658237Z",
            "type": "string"
          },
          "expires_at": {
            "description": "Timestamp of when the query result expires.",
            "example": "2024-12-20T11:04:18.724658237Z",
            "type": "string"
          },
          "is_execution_finished": {
            "description": "Whether the state of the query execution is terminal. This can be used for polling purposes.",
            "example": true,
            "type": "boolean"
          },
          "next_offset": {
            "description": "Offset that can be used to retrieve the next page of results.",
            "example": 100,
            "type": "integer"
          },
          "next_uri": {
            "description": "URI that can be used to fetch the next page of results.",
            "example": "https://api.dune.com/api/v1/execution/01HKZJ2683PHF9Q9PHHQ8FW4Q1/results?offset=100\u0026limit=100",
            "type": "string"
          },
          "query_id": {
            "description": "Unique identifier of the query.",
            "example": 1234,
            "type": "integer"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.QueryResultData"
              }
            ],
            "description": "The object containing the results and metadata of the query execution"
          },
          "state": {
            "description": "The state of the query execution.",
            "example": "QUERY_STATE_COMPLETED",
            "type": "string"
          },
          "submitted_at": {
            "description": "Timestamp of when the query was submitted.",
            "example": "2024-12-20T11:04:18.724658237Z",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.ResolvedQueryOverview": {
        "properties": {
          "created_at": {
            "type": "string"
          },
          "description": {
            "description": "Description of the query",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier of the query",
            "type": "integer"
          },
          "name": {
            "description": "Name of the query",
            "example": "My Query",
            "type": "string"
          },
          "owner": {
            "description": "Owner handle (username or team handle)",
            "type": "string"
          },
          "tags": {
            "description": "Tags associated with the query",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.Row": {
        "additionalProperties": {},
        "type": "object"
      },
      "models.SearchDatasetMetadata": {
        "properties": {
          "abi_type": {
            "type": "string"
          },
          "contract_name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "page_rank_score": {
            "type": "number"
          },
          "project_name": {
            "type": "string"
          },
          "spell_metadata": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "spell_type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.SearchDatasetResult": {
        "properties": {
          "blockchains": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "category": {
            "type": "string"
          },
          "dataset_type": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/models.SearchDatasetMetadata"
          },
          "owner_scope": {
            "type": "string"
          },
          "schema": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "visibility": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.SearchDatasetsByContractAddressRequest": {
        "properties": {
          "blockchains": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "contract_address": {
            "type": "string"
          },
          "include_schema": {
            "type": "boolean"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "required": [
          "contract_address"
        ],
        "type": "object"
      },
      "models.SearchDatasetsPagination": {
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "limit": {
            "type": "integer"
          },
          "next_offset": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.SearchDatasetsRequest": {
        "properties": {
          "blockchains": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "categories": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "dataset_types": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "include_metadata": {
            "type": "boolean"
          },
          "include_private": {
            "type": "boolean"
          },
          "include_schema": {
            "type": "boolean"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "owner_scope": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "schemas": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "models.SearchDatasetsResponse": {
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/models.SearchDatasetsPagination"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/models.SearchDatasetResult"
            },
            "type": "array"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.SyntaxErrorMetadata": {
        "properties": {
          "column": {
            "description": "The column number at which the syntax error occurred.",
            "example": 73,
            "type": "integer"
          },
          "line": {
            "description": "The line number at which the syntax error occurred in the query.",
            "example": 10,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.TableClearResponse": {
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.TableColumn": {
        "properties": {
          "name": {
            "type": "string"
          },
          "nullable": {
            "type": "boolean"
          },
          "type": {
            "description": "ColumnType is a json.RawMessage so that we can support objects like Array and Struct.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "models.TableColumnInfo": {
        "properties": {
          "metadata": {
            "additionalProperties": {},
            "description": "Additional column metadata",
            "type": "object"
          },
          "name": {
            "description": "Column name",
            "type": "string"
          },
          "nullable": {
            "description": "Whether the column can contain null values",
            "type": "boolean"
          },
          "type": {
            "description": "Column data type",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.TableCreateRequest": {
        "properties": {
          "description": {
            "type": "string"
          },
          "is_private": {
            "type": "boolean"
          },
          "namespace": {
            "type": "string"
          },
          "schema": {
            "items": {
              "$ref": "#/components/schemas/models.TableColumn"
            },
            "type": "array"
          },
          "table_name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.TableCreateResponse": {
        "properties": {
          "already_existed": {
            "type": "boolean"
          },
          "example_query": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "namespace": {
            "type": "string"
          },
          "table_name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.TableDeleteResponse": {
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.TableInsertResponse": {
        "properties": {
          "bytes_written": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "rows_written": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.TableListElement": {
        "properties": {
          "columns": {
            "description": "List of table columns",
            "items": {
              "$ref": "#/components/schemas/models.TableColumnInfo"
            },
            "type": "array"
          },
          "created_at": {
            "description": "ISO 8601 timestamp of table creation",
            "type": "string"
          },
          "full_name": {
            "description": "Fully qualified table name (catalog.schema.table)",
            "type": "string"
          },
          "is_private": {
            "description": "Whether the table is private",
            "type": "boolean"
          },
          "owner": {
            "allOf": [
              {
                "$ref": "#/components/schemas/models.TableOwner"
              }
            ],
            "description": "Owner information"
          },
          "purged_at": {
            "description": "ISO 8601 timestamp of when table was purged",
            "type": "string"
          },
          "table_size_bytes": {
            "description": "Size of the table in bytes",
            "type": "string"
          },
          "updated_at": {
            "description": "ISO 8601 timestamp of last update",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.TableListResponse": {
        "properties": {
          "next_offset": {
            "description": "Offset for next page of results",
            "type": "integer"
          },
          "tables": {
            "items": {
              "$ref": "#/components/schemas/models.TableListElement"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "models.TableOwner": {
        "properties": {
          "handle": {
            "description": "User or team identifier",
            "type": "string"
          },
          "type": {
            "description": "Type of entity that created the table",
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.TextWidgetInput": {
        "properties": {
          "position": {
            "$ref": "#/components/schemas/models.WidgetPosition"
          },
          "text": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.TextWidgetOutput": {
        "properties": {
          "position": {
            "$ref": "#/components/schemas/models.WidgetPosition"
          },
          "text": {
            "type": "string"
          },
          "widget_id": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.UpdateDashboardCrudRequest": {
        "properties": {
          "columns_per_row": {
            "type": "integer"
          },
          "is_private": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "param_widgets": {
            "items": {
              "$ref": "#/components/schemas/models.ParamWidgetInput"
            },
            "type": "array"
          },
          "slug": {
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "text_widgets": {
            "items": {
              "$ref": "#/components/schemas/models.TextWidgetInput"
            },
            "type": "array"
          },
          "visualization_widgets": {
            "items": {
              "$ref": "#/components/schemas/models.VisualizationWidgetInput"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "models.UpdateQueryResponse": {
        "properties": {
          "query_id": {
            "description": "The unique ID of the query that was updated",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.UpdateVisualizationRequest": {
        "properties": {
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "options": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "type"
        ],
        "type": "object"
      },
      "models.UpdateVisualizationResponse": {
        "properties": {
          "id": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.VisualizationSummary": {
        "properties": {
          "created_at": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "models.VisualizationWidgetInput": {
        "properties": {
          "position": {
            "$ref": "#/components/schemas/models.WidgetPosition"
          },
          "visualization_id": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.VisualizationWidgetOutput": {
        "properties": {
          "position": {
            "$ref": "#/components/schemas/models.WidgetPosition"
          },
          "visualization_id": {
            "type": "integer"
          },
          "widget_id": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "models.WidgetPosition": {
        "properties": {
          "col": {
            "type": "integer"
          },
          "row": {
            "type": "integer"
          },
          "size_x": {
            "type": "integer"
          },
          "size_y": {
            "type": "integer"
          }
        },
        "type": "object"
      }
    }
  },
  "info": {
    "contact": {},
    "description": "Dune API",
    "title": "DuneAPI",
    "version": "1.0"
  },
  "openapi": "3.0.1",
  "paths": {
    "/v1/dashboards": {
      "post": {
        "description": "Creates a new dashboard with optional visualization and text widgets.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/models.CreateDashboardCrudRequest"
              }
            }
          },
          "description": "CreateDashboardRequest",
          "required": true,
          "x-originalParamName": "body"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.DashboardCrudResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Create a dashboard",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/dashboards/by-slug/{owner_handle}/{slug}": {
      "get": {
        "description": "Retrieves the full state of a dashboard using the owner handle and URL slug.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Owner username or team handle",
            "in": "path",
            "name": "owner_handle",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Dashboard URL slug",
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.DashboardCrudResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get a dashboard by owner handle and slug",
        "x-required-scope": "Read"
      }
    },
    "/v1/dashboards/{dashboard_id}": {
      "get": {
        "description": "Retrieves the full state of a dashboard including widgets.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Dashboard ID",
            "in": "path",
            "name": "dashboard_id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.DashboardCrudResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get a dashboard by ID",
        "x-required-scope": "Read"
      },
      "patch": {
        "description": "Updates dashboard metadata and/or replaces widgets.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Dashboard ID",
            "in": "path",
            "name": "dashboard_id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/models.UpdateDashboardCrudRequest"
              }
            }
          },
          "description": "UpdateDashboardRequest",
          "required": true,
          "x-originalParamName": "body"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.DashboardCrudResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Update a dashboard",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/dashboards/{dashboard_id}/archive": {
      "post": {
        "description": "Archives a dashboard by ID. The dashboard can be restored later.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Dashboard ID",
            "in": "path",
            "name": "dashboard_id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.ArchiveDashboardCrudResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Archive a dashboard",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/datasets": {
      "get": {
        "description": "Retrieve a paginated list of datasets with optional filtering by owner and type",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of results to return (default 50, max 250)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Filter by owner handle",
            "in": "query",
            "name": "owner_handle",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by dataset types (comma-separated: transformation_view, transformation_table, uploaded_table, decoded_table, spell, dune_table)",
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.ListDatasetsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "List datasets",
        "x-required-scope": "Read"
      }
    },
    "/v1/datasets/search": {
      "post": {
        "description": "Search for datasets across the Dune catalog, with filtering by categories, blockchains, schemas, and more",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/models.SearchDatasetsRequest"
              }
            }
          },
          "description": "Search datasets request",
          "required": true,
          "x-originalParamName": "body"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.SearchDatasetsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Search datasets",
        "x-required-scope": "Read"
      }
    },
    "/v1/datasets/search-by-contract": {
      "post": {
        "description": "Find decoded datasets associated with a smart contract address",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/models.SearchDatasetsByContractAddressRequest"
              }
            }
          },
          "description": "Search by contract address request",
          "required": true,
          "x-originalParamName": "body"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.SearchDatasetsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Search datasets by contract address",
        "x-required-scope": "Read"
      }
    },
    "/v1/datasets/{slug}": {
      "get": {
        "description": "Retrieve dataset information including columns, metadata, and ownership details",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Dataset slug (e.g., 'dex.trades')",
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.DatasetResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get a dataset by slug",
        "x-required-scope": "Read"
      }
    },
    "/v1/endpoints/{handle}/{endpoint_slug}/results": {
      "get": {
        "description": "Create custom API endpoints from Dune queries",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Your user or team handle",
            "in": "path",
            "name": "handle",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The name of the endpoint as slug",
            "in": "path",
            "name": "endpoint_slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This enables returning a query result that was too large and only a partial result is\navailable. By default, allow_partial_results is set to false and a failed state is returned.",
            "in": "query",
            "name": "allow_partial_results",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Specifies a comma-separated list of column names to return. If omitted, all columns are included.\nTip: use this to limit the result to specific columns, reducing datapoints cost of the call.",
            "in": "query",
            "name": "columns",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Expression to filter out rows from the results to return. This expression is similar to\na SQL WHERE clause. More details about it in the Filtering section of the doc.\nThis parameter is incompatible with sample_count.",
            "in": "query",
            "name": "filters",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "To bypass the default max credits per request limit, set ignore_max_credits_per_request=true",
            "in": "query",
            "name": "ignore_max_credits_per_request",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Limit number of rows to return. This together with 'offset' allows easy pagination through\nresults in an incremental and efficient way. This parameter is incompatible\nwith sampling (sample_count).",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset row number to start (inclusive, first row means offset=0) returning results\nfrom. This together with 'limit' allows easy pagination through results in an\nincremental and efficient way. This parameter is incompatible with sampling (sample_count).",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "queryID",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Number of rows to return from the result by sampling the data. This is useful when you\nwant to get a uniform sample instead of the entire result. If the result has less\nthan the sample count, the entire result is returned. Note that this will return a\nrandomized sample, so not every call will return the same result. This parameter is\nincompatible with `offset`, `limit`, and `filters` parameters.",
            "in": "query",
            "name": "sample_count",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Expression to define the order in which the results should be returned. This expression\nis similar to a SQL ORDER BY clause. More details about it in the Sorting section of the doc.",
            "in": "query",
            "name": "sort_by",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.ReadExecutionResultResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error402"
                }
              }
            },
            "description": "Payment Required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Custom Endpoints",
        "x-required-scope": "Read"
      }
    },
    "/v1/execution/{execution_id}/cancel": {
      "post": {
        "description": "Cancel a triggered execution request given the execution ID",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The unique identifier of the execution",
            "in": "path",
            "name": "execution_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.CancelQueryExecutionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Cancel a triggered execution request given the execution ID",
        "x-required-scope": "Read"
      }
    },
    "/v1/execution/{execution_id}/results": {
      "get": {
        "description": "Given an execution ID, returns result of a an execution request",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Execution ID",
            "in": "path",
            "name": "execution_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This enables returning a query result that was too large and only a partial result is\navailable. By default, allow_partial_results is set to false and a failed state is returned.",
            "in": "query",
            "name": "allow_partial_results",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Specifies a comma-separated list of column names to return. If omitted, all columns are included.\nTip: use this to limit the result to specific columns, reducing datapoints cost of the call.",
            "in": "query",
            "name": "columns",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Expression to filter out rows from the results to return. This expression is similar to\na SQL WHERE clause. More details about it in the Filtering section of the doc.\nThis parameter is incompatible with sample_count.",
            "in": "query",
            "name": "filters",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "To bypass the default max credits per request limit, set ignore_max_credits_per_request=true",
            "in": "query",
            "name": "ignore_max_credits_per_request",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Limit number of rows to return. This together with 'offset' allows easy pagination through\nresults in an incremental and efficient way. This parameter is incompatible\nwith sampling (sample_count).",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset row number to start (inclusive, first row means offset=0) returning results\nfrom. This together with 'limit' allows easy pagination through results in an\nincremental and efficient way. This parameter is incompatible with sampling (sample_count).",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Number of rows to return from the result by sampling the data. This is useful when you\nwant to get a uniform sample instead of the entire result. If the result has less\nthan the sample count, the entire result is returned. Note that this will return a\nrandomized sample, so not every call will return the same result. This parameter is\nincompatible with `offset`, `limit`, and `filters` parameters.",
            "in": "query",
            "name": "sample_count",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Expression to define the order in which the results should be returned. This expression\nis similar to a SQL ORDER BY clause. More details about it in the Sorting section of the doc.",
            "in": "query",
            "name": "sort_by",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.ReadExecutionResultResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error402"
                }
              }
            },
            "description": "Payment Required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Given an execution ID, returns result of a an execution request",
        "x-payment-info": {
          "amount": null,
          "description": "$1.00 per MB of result data.",
          "intent": "session",
          "method": "tempo"
        },
        "x-required-scope": "Read"
      }
    },
    "/v1/execution/{execution_id}/results/csv": {
      "get": {
        "description": "Given a query ID, returns the latest executed result of a query on Dune in CSV format",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Execution ID",
            "in": "path",
            "name": "execution_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This enables returning a query result that was too large and only a partial result is\navailable. By default, allow_partial_results is set to false and a failed state is returned.",
            "in": "query",
            "name": "allow_partial_results",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Specifies a comma-separated list of column names to return. If omitted, all columns are included.\nTip: use this to limit the result to specific columns, reducing datapoints cost of the call.",
            "in": "query",
            "name": "columns",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Expression to filter out rows from the results to return. This expression is similar to\na SQL WHERE clause. More details about it in the Filtering section of the doc.\nThis parameter is incompatible with sample_count.",
            "in": "query",
            "name": "filters",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "To bypass the default max credits per request limit, set ignore_max_credits_per_request=true",
            "in": "query",
            "name": "ignore_max_credits_per_request",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Limit number of rows to return. This together with 'offset' allows easy pagination through\nresults in an incremental and efficient way. This parameter is incompatible\nwith sampling (sample_count).",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset row number to start (inclusive, first row means offset=0) returning results\nfrom. This together with 'limit' allows easy pagination through results in an\nincremental and efficient way. This parameter is incompatible with sampling (sample_count).",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Number of rows to return from the result by sampling the data. This is useful when you\nwant to get a uniform sample instead of the entire result. If the result has less\nthan the sample count, the entire result is returned. Note that this will return a\nrandomized sample, so not every call will return the same result. This parameter is\nincompatible with `offset`, `limit`, and `filters` parameters.",
            "in": "query",
            "name": "sample_count",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Expression to define the order in which the results should be returned. This expression\nis similar to a SQL ORDER BY clause. More details about it in the Sorting section of the doc.",
            "in": "query",
            "name": "sort_by",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error402"
                }
              }
            },
            "description": "Payment Required"
          },
          "404": {
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get results of a query execution in CSV format",
        "x-payment-info": {
          "amount": null,
          "description": "$1.00 per MB of result data.",
          "intent": "session",
          "method": "tempo"
        },
        "x-required-scope": "Read"
      }
    },
    "/v1/execution/{execution_id}/status": {
      "get": {
        "description": "Check the status of an execution request",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Execution ID",
            "in": "path",
            "name": "execution_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.GetExecutionStatusResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error402"
                }
              }
            },
            "description": "Payment Required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Check the status of an execution request",
        "x-payment-info": {
          "amount": null,
          "description": "Free status polling.",
          "intent": "session",
          "method": "tempo"
        },
        "x-required-scope": "Read"
      }
    },
    "/v1/materialized-views": {
      "get": {
        "description": "This lists all materialized view owned by the account tied to the API key",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of materialized views to return on a page. Default and max 10000",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Offset used for pagination. Use the value provided on a previous response under next_offset",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/matviews.MatviewsListResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "This lists all materialized view owned by the account tied to the API key",
        "x-required-scope": "Read"
      },
      "post": {
        "description": "This upserts a materialized view from an existing query. If the materialized view with the given name",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/matviews.MatviewsUpsertRequest"
              }
            }
          },
          "description": "MatviewsUpsertRequest",
          "x-originalParamName": "body"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/matviews.MatviewsUpsertResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "This upserts (create or replace) a materialized view from an existing query",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/materialized-views/{name}": {
      "delete": {
        "description": "This deletes a materialized view given a full name",
        "parameters": [
          {
            "description": "Matview Name",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/matviews.MatviewsDeleteResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "This deletes a materialized view given a full name",
        "x-required-scope": "Read/Write"
      },
      "get": {
        "description": "This fetches a materialized view given a name",
        "parameters": [
          {
            "description": "Matview Name",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/matviews.MatviewsGetResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "This fetches a materialized view given a name",
        "x-required-scope": "Read"
      }
    },
    "/v1/materialized-views/{name}/refresh": {
      "post": {
        "description": "This refreshes a materialized view",
        "parameters": [
          {
            "description": "Matview Name",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/matviews.MatviewsRefreshRequest"
              }
            }
          },
          "description": "MatviewsRefreshRequest",
          "x-originalParamName": "body"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/matviews.MatviewsRefreshResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "This refreshes a materialized view",
        "x-required-scope": "Read"
      }
    },
    "/v1/pipelines/execute": {
      "post": {
        "description": "Executes a specified pipeline. A pipeline allows you to chain multiple queries and materialized view refreshes together and execute them as a single unit.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/models.ExecutePipelineRequest"
              }
            }
          },
          "description": "Pipeline execution request",
          "required": true,
          "x-originalParamName": "body"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.ExecutePipelineResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Execute a pipeline",
        "x-required-scope": "Read"
      }
    },
    "/v1/pipelines/executions/{pipeline_execution_id}/status": {
      "get": {
        "description": "Retrieves the status of a pipeline execution, including the status of each node in the pipeline.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique identifier of the pipeline execution",
            "in": "path",
            "name": "pipeline_execution_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.GetPipelineExecutionStatusResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get pipeline execution status",
        "x-required-scope": "Read"
      }
    },
    "/v1/queries": {
      "get": {
        "description": "Retrieve a paginated list of queries owned by the account tied to the API key",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of queries to return on a page. Default: 20",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset used for pagination. Default: 0",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.ListQueriesResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "List queries",
        "x-required-scope": "Read"
      }
    },
    "/v1/queries/{query_id}/visualizations": {
      "get": {
        "description": "Lists all visualizations attached to the specified query with pagination.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Query ID",
            "in": "path",
            "name": "query_id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Max results to return (default 25, max 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination offset (default 0)",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.ListVisualizationsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "List visualizations for a query",
        "x-required-scope": "Read"
      },
      "post": {
        "description": "Creates a new visualization attached to the specified query.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Query ID",
            "in": "path",
            "name": "query_id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/models.CreateVisualizationRequest"
              }
            }
          },
          "description": "CreateVisualizationRequest",
          "required": true,
          "x-originalParamName": "body"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.CreateVisualizationResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Create a visualization on an existing query",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/query": {
      "post": {
        "description": "This API allows for anyone to create a query.\nThe owner of the query will be under the context of the API key.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/models.CreateQueryRequest"
              }
            }
          },
          "description": "CreateQueryRequest",
          "required": true,
          "x-originalParamName": "body"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.CreateQueryResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error402"
                }
              }
            },
            "description": "Payment Required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Create and save a query on Dune",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/query/{queryId}": {
      "get": {
        "description": "This API allows for anyone to read the sql text,\nparameters, name, tags, and state of a query.\nFor private queries, only the API key generated\nunder the context of the owner of that query will work.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Query ID",
            "in": "path",
            "name": "queryId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.GetQueryResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Returns the details of a query on Dune",
        "x-required-scope": "Read"
      },
      "patch": {
        "description": "This API allows for anyone to update the sql text,\nparameters, name, tags, and state of a query. Only the API key\ngenerated under the context of the owner of that query will work.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Query ID",
            "in": "path",
            "name": "queryId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.UpdateQueryResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error402"
                }
              }
            },
            "description": "Payment Required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Update the details of a query on Dune",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/query/{queryId}/archive": {
      "post": {
        "description": "This API allows for anyone to archive a query. Only the API key\ngenerated under the context of the owner of that query will work.\nThis does not delete the query, but will make\nit uneditable/unexecutable",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Query ID",
            "in": "path",
            "name": "queryId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.UpdateQueryResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Archive Query on Dune",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/query/{queryId}/private": {
      "post": {
        "description": "This API allows for anyone to private a query. Only the API key\ngenerated under the context of the owner of that query will work.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Query ID",
            "in": "path",
            "name": "queryId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.UpdateQueryResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error402"
                }
              }
            },
            "description": "Payment Required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Private Query on Dune",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/query/{queryId}/unarchive": {
      "post": {
        "description": "This API allows for anyone to unarchive a query. Only the API key\ngenerated under the context of the owner of that query will work.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Query ID",
            "in": "path",
            "name": "queryId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.UpdateQueryResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Unarchive Query on Dune",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/query/{queryId}/unprivate": {
      "post": {
        "description": "This API allows for anyone to unprivate a query. Only the API key\ngenerated under the context of the owner of that query will work.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Query ID",
            "in": "path",
            "name": "queryId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.UpdateQueryResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Unprivate a query on Dune",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/query/{query_id}/execute": {
      "post": {
        "description": "Execute, or run a query for the specified query ID",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique identifier of the query",
            "in": "path",
            "name": "query_id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "The performance engine tier the execution will be run on. Can be `small`, `medium`, or `large`. Omit to use the default tier for the query engine. Credits are consumed based on actual compute resources used.",
            "in": "query",
            "name": "performance",
            "schema": {
              "enum": [
                "small",
                "medium",
                "large"
              ],
              "type": "string"
            }
          },
          {
            "description": "SQL Query parameters in json key-value pairs. Each parameter is to be provided in key-value pairs. This enables you to execute a parameterized query with the provided values for your parameter keys. Partial submission of parameters is allowed. For example, if the query expects three parameters and you only pass in two, the third one will automatically use its default value as defined in the Query Parameter Editor page.",
            "in": "query",
            "name": "query_parameters",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.ExecuteQueryResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error402"
                }
              }
            },
            "description": "Payment Required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Execute, or run a query for the specified query ID",
        "x-required-scope": "Read"
      }
    },
    "/v1/query/{query_id}/pipeline": {
      "get": {
        "description": "Builds a query pipeline from the specified query and returns the pipeline definition containing all the nested materialized views that the query depends on. A pipeline allows you to chain multiple queries together and execute them as a single unit.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique identifier of the query",
            "in": "path",
            "name": "query_id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "The performance engine tier. Can be `small`, `medium`, or `large`.",
            "in": "query",
            "name": "performance",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "SQL Query parameters in json key-value pairs",
            "in": "query",
            "name": "query_parameters",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.GetQueryPipelineResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get query pipeline",
        "x-required-scope": "Read"
      }
    },
    "/v1/query/{query_id}/pipeline/execute": {
      "post": {
        "description": "Builds a query pipeline from the specified query and executes it. A pipeline allows you to chain multiple queries together and execute them as a single unit.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique identifier of the query",
            "in": "path",
            "name": "query_id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/models.ExecuteQueryPipelineRequest"
              }
            }
          },
          "description": "Query pipeline execution request",
          "required": true,
          "x-originalParamName": "body"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.ExecuteQueryPipelineResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Execute a query pipeline",
        "x-required-scope": "Read"
      }
    },
    "/v1/query/{query_id}/results": {
      "get": {
        "description": "Given a query ID, returns the latest executed result of a query on Dune in JSON format",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Query ID",
            "in": "path",
            "name": "query_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This enables returning a query result that was too large and only a partial result is\navailable. By default, allow_partial_results is set to false and a failed state is returned.",
            "in": "query",
            "name": "allow_partial_results",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Specifies a comma-separated list of column names to return. If omitted, all columns are included.\nTip: use this to limit the result to specific columns, reducing datapoints cost of the call.",
            "in": "query",
            "name": "columns",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Expression to filter out rows from the results to return. This expression is similar to\na SQL WHERE clause. More details about it in the Filtering section of the doc.\nThis parameter is incompatible with sample_count.",
            "in": "query",
            "name": "filters",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "To bypass the default max credits per request limit, set ignore_max_credits_per_request=true",
            "in": "query",
            "name": "ignore_max_credits_per_request",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Limit number of rows to return. This together with 'offset' allows easy pagination through\nresults in an incremental and efficient way. This parameter is incompatible\nwith sampling (sample_count).",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset row number to start (inclusive, first row means offset=0) returning results\nfrom. This together with 'limit' allows easy pagination through results in an\nincremental and efficient way. This parameter is incompatible with sampling (sample_count).",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "queryID",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Number of rows to return from the result by sampling the data. This is useful when you\nwant to get a uniform sample instead of the entire result. If the result has less\nthan the sample count, the entire result is returned. Note that this will return a\nrandomized sample, so not every call will return the same result. This parameter is\nincompatible with `offset`, `limit`, and `filters` parameters.",
            "in": "query",
            "name": "sample_count",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Expression to define the order in which the results should be returned. This expression\nis similar to a SQL ORDER BY clause. More details about it in the Sorting section of the doc.",
            "in": "query",
            "name": "sort_by",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.ReadExecutionResultResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get Latest Query Result",
        "x-required-scope": "Read"
      }
    },
    "/v1/query/{query_id}/results/csv": {
      "get": {
        "description": "Given a query ID, returns the latest executed result of a query on Dune as CSV",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Query ID",
            "in": "path",
            "name": "query_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This enables returning a query result that was too large and only a partial result is\navailable. By default, allow_partial_results is set to false and a failed state is returned.",
            "in": "query",
            "name": "allow_partial_results",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Specifies a comma-separated list of column names to return. If omitted, all columns are included.\nTip: use this to limit the result to specific columns, reducing datapoints cost of the call.",
            "in": "query",
            "name": "columns",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Expression to filter out rows from the results to return. This expression is similar to\na SQL WHERE clause. More details about it in the Filtering section of the doc.\nThis parameter is incompatible with sample_count.",
            "in": "query",
            "name": "filters",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "To bypass the default max credits per request limit, set ignore_max_credits_per_request=true",
            "in": "query",
            "name": "ignore_max_credits_per_request",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Limit number of rows to return. This together with 'offset' allows easy pagination through\nresults in an incremental and efficient way. This parameter is incompatible\nwith sampling (sample_count).",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Offset row number to start (inclusive, first row means offset=0) returning results\nfrom. This together with 'limit' allows easy pagination through results in an\nincremental and efficient way. This parameter is incompatible with sampling (sample_count).",
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "queryID",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Number of rows to return from the result by sampling the data. This is useful when you\nwant to get a uniform sample instead of the entire result. If the result has less\nthan the sample count, the entire result is returned. Note that this will return a\nrandomized sample, so not every call will return the same result. This parameter is\nincompatible with `offset`, `limit`, and `filters` parameters.",
            "in": "query",
            "name": "sample_count",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Expression to define the order in which the results should be returned. This expression\nis similar to a SQL ORDER BY clause. More details about it in the Sorting section of the doc.",
            "in": "query",
            "name": "sort_by",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Given a query ID, returns the latest executed result of a query on Dune as CSV",
        "x-required-scope": "Read"
      }
    },
    "/v1/sql/execute": {
      "post": {
        "description": "Execute raw SQL query without requiring a stored query ID",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/models.ExecuteSQLRequest"
              }
            }
          },
          "description": "ExecuteSQLRequest",
          "required": true,
          "x-originalParamName": "body"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.ExecuteQueryResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error402"
                }
              }
            },
            "description": "Payment Required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Execute raw SQL query",
        "x-payment-info": {
          "amount": null,
          "description": "Reserves $5.00; actual cost based on execution compute.",
          "intent": "session",
          "method": "tempo"
        },
        "x-required-scope": "Read"
      }
    },
    "/v1/uploads": {
      "get": {
        "description": "Returns a paginated list of all tables owned by the authenticated account.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of tables to return on a page. Default: 50, max: 10000",
            "in": "query",
            "name": "limit",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "description": "Offset used for pagination. Negative values are treated as 0",
            "in": "query",
            "name": "offset",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.TableListResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "List all tables owned by the account",
        "x-required-scope": "Read"
      },
      "post": {
        "description": "Creates an empty uploaded table that can be inserted into with the /insert endpoint.\nEach successful table creation consumes 10 credits.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/models.TableCreateRequest"
              }
            }
          },
          "description": "payload",
          "x-originalParamName": "payload"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.TableCreateResponse"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.TableCreateResponse"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Create an empty uploaded table with a defined schema",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/uploads/csv": {
      "post": {
        "description": "Upload a CSV file to create a table with automatic schema inference.\nThe size limit per upload is 500MB. Storage limits: 100MB (free), 1GB (analyst), 15GB (plus).",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/models.CSVUploadRequest"
              }
            }
          },
          "description": "payload",
          "required": true,
          "x-originalParamName": "payload"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.CSVUploadResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Upload CSV file as a table",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/uploads/{namespace}/{table_name}": {
      "delete": {
        "description": "Permanently deletes the specified uploaded table and all its data.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The namespace of the table to delete",
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The table name of the table to delete",
            "in": "path",
            "name": "table_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.TableDeleteResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Delete an uploaded table",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/uploads/{namespace}/{table_name}/clear": {
      "post": {
        "description": "Removes all data from the specified uploaded table while preserving the table structure and schema.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The namespace of the table to clear",
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The table name of the table to clear",
            "in": "path",
            "name": "table_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.TableClearResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Clear all data from an uploaded table",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/uploads/{namespace}/{table_name}/insert": {
      "post": {
        "description": "Inserts data into an existing table. Accepts CSV (text/csv) or\nNDJSON (application/x-ndjson) content types.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alternative to using the X-Dune-Api-Key header",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The namespace of the table",
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The table name",
            "in": "path",
            "name": "table_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Content type: text/csv or application/x-ndjson",
            "in": "header",
            "name": "Content-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "type": "string"
              }
            }
          },
          "description": "The data to insert (CSV or NDJSON format)",
          "required": true,
          "x-originalParamName": "data"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.TableInsertResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Insert data into an uploaded table",
        "x-required-scope": "Read/Write"
      }
    },
    "/v1/usage": {
      "post": {
        "description": "Get usage data for the authenticated customer including private queries, dashboards,\nbytes used/allowed, and billing periods",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "API Key, alternative to using the HTTP header X-Dune-Api-Key",
            "in": "query",
            "name": "api_key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/models.GetUsageRequest"
              }
            }
          },
          "description": "Request payload with optional start_date and end_date",
          "x-originalParamName": "payload"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.GetUsageResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get Usage Data",
        "x-required-scope": "Read"
      }
    },
    "/v1/visualizations/{visualization_id}": {
      "delete": {
        "description": "Deletes a visualization by its ID.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Visualization ID",
            "in": "path",
            "name": "visualization_id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.DeleteVisualizationResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Delete a visualization",
        "x-required-scope": "Read/Write"
      },
      "get": {
        "description": "Retrieves a visualization by its ID.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Visualization ID",
            "in": "path",
            "name": "visualization_id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.GetVisualizationResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get a visualization by ID",
        "x-required-scope": "Read"
      },
      "put": {
        "description": "Updates an existing visualization by its ID.",
        "parameters": [
          {
            "description": "API Key for the service",
            "in": "header",
            "name": "X-Dune-Api-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Visualization ID",
            "in": "path",
            "name": "visualization_id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/models.UpdateVisualizationRequest"
              }
            }
          },
          "description": "UpdateVisualizationRequest",
          "required": true,
          "x-originalParamName": "body"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.UpdateVisualizationResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error400"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error401"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error403"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error404"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.Error500"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Update a visualization",
        "x-required-scope": "Read/Write"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.dune.com/api"
    }
  ],
  "x-service-info": {
    "categories": [
      "data",
      "compute"
    ],
    "docs": {
      "apiReference": "https://docs.dune.com/api-reference/overview/introduction",
      "homepage": "https://docs.dune.com"
    }
  }
}
