{
  "openapi": "3.0.1",
  "info": {
    "title": "SeekTable",
    "description": "Generates tabular reports saved in your SeekTable account.",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://www.seektable.com/"
    }
  ],
  "tags": [],
  "paths": {
    "/api/report": {
      "get": {
        "summary": "Get Reports List",
        "description": "Gets a list of reports",
        "operationId": "ReportList",
        "responses": {
          "default": {
            "description": "default",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "Id": {
                        "type": "string",
                        "description": "Id"
                      },
                      "Name": {
                        "type": "string",
                        "description": "Name"
                      },
                      "ReportType": {
                        "type": "string",
                        "description": "ReportType"
                      },
                      "CreateDate": {
                        "type": "string",
                        "description": "CreateDate"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-ms-visibility": "internal"
      }
    },
    "/api/report/{report_id}/export": {
      "get": {
        "summary": "Report Export",
        "description": "Exports specified report to PDF/Excel/CSV/HTML/JSON file.",
        "operationId": "ReportExport",
        "parameters": [
          {
            "name": "report_id",
            "in": "path",
            "description": "Report ID",
            "required": true,
            "schema": {
              "type": "string",
              "x-ms-summary": "Report ID",
              "x-ms-dynamic-values": {
                "operationId": "ReportList",
                "value-path": "Id",
                "value-title": "Name"
              }
            },
            "x-ms-summary": "Report ID",
            "x-ms-dynamic-values": {
              "operationId": "ReportList",
              "value-path": "Id",
              "value-title": "Name"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Format",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "pdf",
                "csv",
                "excel",
                "excelpivottable",
                "json",
                "html",
                "png"
              ],
              "x-ms-summary": "Format"
            },
            "x-ms-summary": "Format"
          },
          {
            "name": "report_parameters",
            "in": "query",
            "description": "Serialized JSON object with report parameters",
            "schema": {
              "type": "string",
              "x-ms-summary": "Serialized JSON object with report parameters"
            },
            "x-ms-summary": "Serialized JSON object with report parameters"
          },
          {
            "name": "html_inline_style",
            "in": "query",
            "description": "Enable inline styles for HTML",
            "schema": {
              "type": "boolean",
              "x-ms-summary": "Enable inline styles for HTML export."
            },
            "x-ms-summary": "Enable inline styles for HTML export."
          },
          {
            "name": "chart_only",
            "in": "query",
            "description": "Chart Only",
            "schema": {
              "type": "boolean",
              "x-ms-summary": "Export only chart for PDF or PNG export."
            },
            "x-ms-summary": "Export only chart for PDF or PNG export."
          }
        ],
        "responses": {
          "default": {
            "description": "default",
            "content": {
              "*/*": {
                "schema": {
                  "title": "Export Result",
                  "type": "string",
                  "format": "binary",
                  "x-ms-visibility": ""
                }
              }
            }
          }
        }
      }
    },
    "/api/cube/import/csv": {
      "post": {
        "summary": "Upload CSV File",
        "description": "Uploads a CSV file to refresh existing cube",
        "operationId": "CubeImportCsv",
        "parameters": [
          {
            "name": "cubeId",
            "in": "query",
            "description": "Cube ID",
            "required": true,
            "schema": {
              "type": "string",
              "x-ms-summary": "Cube ID",
              "x-ms-dynamic-values": {
                "operationId": "CsvCubeList",
                "value-path": "Id",
                "value-title": "Name",
                "parameters": {
                  "source_type": "file-csv"
                }
              }
            },
            "x-ms-summary": "Cube ID",
            "x-ms-dynamic-values": {
              "operationId": "CsvCubeList",
              "value-path": "Id",
              "value-title": "Name",
              "parameters": {
                "source_type": "file-csv"
              }
            }
          },
          {
            "name": "filename",
            "in": "query",
            "description": "CSV File Name",
            "schema": {
              "type": "string",
              "x-ms-summary": "CSV File Name"
            },
            "x-ms-summary": "CSV File Name"
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "default": {
            "description": "default",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "CSV content"
      }
    },
    "/api/cube": {
      "get": {
        "summary": "List of CSV cubes",
        "description": "List of CSV cubes",
        "operationId": "CsvCubeList",
        "parameters": [
          {
            "name": "source_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "default": "file-csv",
              "x-ms-visibility": "internal"
            },
            "x-ms-visibility": "internal"
          }
        ],
        "responses": {
          "default": {
            "description": "default",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "Id": {
                        "type": "string",
                        "description": "Id"
                      },
                      "Name": {
                        "type": "string",
                        "description": "Name"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-ms-visibility": "internal"
      }
    },
    "/api/report/{report_id}/share/email": {
      "post": {
        "summary": "Share report by email",
        "description": "Sends report in email body",
        "operationId": "ReportShareByEmail",
        "parameters": [
          {
            "name": "report_id",
            "in": "path",
            "description": "Report ID",
            "required": true,
            "schema": {
              "type": "string",
              "x-ms-summary": "Report ID",
              "x-ms-dynamic-values": {
                "operationId": "ReportList",
                "value-path": "Id",
                "value-title": "Name"
              }
            },
            "x-ms-summary": "Report ID",
            "x-ms-dynamic-values": {
              "operationId": "ReportList",
              "value-path": "Id",
              "value-title": "Name"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "To",
            "required": true,
            "schema": {
              "type": "string",
              "x-ms-summary": "To"
            },
            "x-ms-summary": "To"
          },
          {
            "name": "subject",
            "in": "query",
            "description": "Subject",
            "required": true,
            "schema": {
              "type": "string",
              "x-ms-summary": "Subject"
            },
            "x-ms-summary": "Subject"
          },
          {
            "name": "message",
            "in": "query",
            "description": "Message",
            "schema": {
              "type": "string",
              "x-ms-summary": "Content for email body (placed above the report)."
            },
            "x-ms-summary": "Content for email body (placed above the report)."
          },
          {
            "name": "include_report_html",
            "in": "query",
            "description": "Embed report into mail body.",
            "schema": {
              "type": "boolean",
              "x-ms-summary": "Embed report into mail body."
            },
            "x-ms-summary": "Embed report into mail body."
          },
          {
            "name": "report_parameters",
            "in": "query",
            "description": "Serialized JSON object with report parameters",
            "schema": {
              "type": "string",
              "x-ms-summary": "Serialized JSON object with report parameters"
            },
            "x-ms-summary": "Serialized JSON object with report parameters"
          },
          {
            "name": "attach_export",
            "in": "query",
            "description": "Comma-separated list of attached exports (pdf, csv, excel, excelpivottable)",
            "schema": {
              "type": "string",
              "x-ms-summary": "Comma-separated list of attached exports (pdf, csv, excel, excelpivottable)"
            },
            "x-ms-summary": "Comma-separated list of attached exports (pdf, csv, excel, excelpivottable)"
          }
        ],
        "responses": {
          "default": {
            "description": "default",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    }
  }
}