{
  "openapi": "3.1.0",
  "info": {
    "title": "Rippit Bulk API",
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "https://integrations.rippit.com/api/v2"
    }
  ],
  "paths": {
    "/bulk_ingest/jobs/{job_id}/start": {
      "post": {
        "tags": [
          "bulk_ingest"
        ],
        "summary": "Post Job Start",
        "description": "Call this once the file is uploaded. Sets the job to `queued` and starts processing.\n\nReturns 409 if nothing was uploaded yet or the job was already started.\nReturns 413 if the file is over 128MB.",
        "operationId": "post_job_start_bulk_ingest_jobs__job_id__start_post",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkJob"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "413": {
            "description": "Request Entity Too Large"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/bulk_ingest/conversation_sources": {
      "get": {
        "tags": [
          "bulk_ingest"
        ],
        "summary": "Get Conversation Sources",
        "description": "Lists your conversation sources.",
        "operationId": "get_conversation_sources_bulk_ingest_conversation_sources_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ConversationSourceInfo"
                  },
                  "type": "array",
                  "title": "Response Get Conversation Sources Bulk Ingest Conversation Sources Get"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "bulk_ingest"
        ],
        "summary": "Post Conversation Source",
        "description": "Names a conversation source. Create it before uploading with `/conversation_blocks/bulk?source=<name>`.\n\nFull guide with examples: [Conversations guide](/api-reference/connect/bulk/conversations)",
        "operationId": "post_conversation_source_bulk_ingest_conversation_sources_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationSourceInit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationSourceInitResult"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/bulk_ingest/conversation_blocks/bulk": {
      "post": {
        "tags": [
          "bulk_ingest"
        ],
        "summary": "Post Conversation Blocks Bulk",
        "description": "Creates an upload job and returns a one-time upload url, valid for 1 hour.\n\nUpload a jsonl file with one `ConversationBlock` per line, then call\n`POST /jobs/{job_id}/start`. 404 if `source` hasn't been created.\n\nFull guide with examples: [Conversations guide](/api-reference/connect/bulk/conversations)",
        "operationId": "post_conversation_blocks_bulk_bulk_ingest_conversation_blocks_bulk_post",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128,
              "description": "A name created with `POST /conversation_sources`.",
              "title": "Source"
            },
            "description": "A name created with `POST /conversation_sources`."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/bulk_ingest/datasets": {
      "post": {
        "tags": [
          "bulk_ingest"
        ],
        "summary": "Post Dataset",
        "description": "Creates a dataset. New columns are added automatically on write.\n\nLoad rows with `POST /datasets/bulk?dataset_id=...`.\n\nFull guide with examples: [Tables guide](/api-reference/connect/bulk/tables)",
        "operationId": "post_dataset_bulk_ingest_datasets_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetInit"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetInitResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "bulk_ingest"
        ],
        "summary": "Get Datasets",
        "description": "Lists your datasets.",
        "operationId": "get_datasets_bulk_ingest_datasets_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DatasetInfo"
                  },
                  "title": "Response Get Datasets Bulk Ingest Datasets Get"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "bulk_ingest"
        ],
        "summary": "Patch Dataset By Query",
        "description": "Renames the table, relabels or hides columns, sets the conversation link column, and marks it active or inactive. Fields you leave out don't change.",
        "operationId": "patch_dataset_by_query_bulk_ingest_datasets_patch",
        "parameters": [
          {
            "name": "dataset_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "From [Post Dataset](https://docs.rippit.com/api-reference/bulk_ingest/post-dataset). Pass this or `table_id`.",
              "title": "Dataset Id"
            },
            "description": "From [Post Dataset](https://docs.rippit.com/api-reference/bulk_ingest/post-dataset). Pass this or `table_id`."
          },
          {
            "name": "table_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "From [list_data_sources](https://docs.rippit.com/api-reference/list_data_sources). Pass this or `dataset_id`.",
              "title": "Table Id"
            },
            "description": "From [list_data_sources](https://docs.rippit.com/api-reference/list_data_sources). Pass this or `dataset_id`."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetEdit"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetInfo"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/bulk_ingest/datasets/{dataset_id}": {
      "patch": {
        "tags": [
          "bulk_ingest"
        ],
        "summary": "Patch Dataset",
        "description": "Renames the table, relabels or hides columns, sets the conversation link column, and marks it active or inactive. Fields you leave out don't change.",
        "operationId": "patch_dataset_bulk_ingest_datasets__dataset_id__patch",
        "deprecated": true,
        "parameters": [
          {
            "name": "dataset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Dataset Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetEdit"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetInfo"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/bulk_ingest/datasets/bulk": {
      "post": {
        "tags": [
          "bulk_ingest"
        ],
        "summary": "Post Dataset Bulk By Query",
        "description": "Same as `/conversation_blocks/bulk`, but for dataset rows. 404 if the dataset isn't in your account.",
        "operationId": "post_dataset_bulk_by_query_bulk_ingest_datasets_bulk_post",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": true,
            "schema": {
              "enum": [
                "jsonl",
                "parquet"
              ],
              "type": "string",
              "title": "Format"
            }
          },
          {
            "name": "dataset_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "From [Post Dataset](https://docs.rippit.com/api-reference/bulk_ingest/post-dataset). Pass this or `table_id`.",
              "title": "Dataset Id"
            },
            "description": "From [Post Dataset](https://docs.rippit.com/api-reference/bulk_ingest/post-dataset). Pass this or `table_id`."
          },
          {
            "name": "table_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "From [list_data_sources](https://docs.rippit.com/api-reference/list_data_sources). Pass this or `dataset_id`.",
              "title": "Table Id"
            },
            "description": "From [list_data_sources](https://docs.rippit.com/api-reference/list_data_sources). Pass this or `dataset_id`."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/bulk_ingest/datasets/{dataset_id}/bulk": {
      "post": {
        "tags": [
          "bulk_ingest"
        ],
        "summary": "Post Dataset Bulk",
        "description": "Same as `/conversation_blocks/bulk`, but for dataset rows. 404 if the dataset isn't in your account.",
        "operationId": "post_dataset_bulk_bulk_ingest_datasets__dataset_id__bulk_post",
        "deprecated": true,
        "parameters": [
          {
            "name": "dataset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Dataset Id"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": true,
            "schema": {
              "enum": [
                "jsonl",
                "parquet"
              ],
              "type": "string",
              "title": "Format"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/bulk_export/tables": {
      "post": {
        "tags": [
          "bulk_export"
        ],
        "summary": "Create Export Job",
        "description": "Export any table from [list_data_sources](https://docs.rippit.com/api-reference/list_data_sources), or a worksheet, to files, with no row cap.\n\nThe body is an optional query; an empty body exports every row and column.\nPoll [Get Job](https://docs.rippit.com/api-reference/bulk/get-job) until `status` is `done`. Returns 429 over the hourly/daily export or egress limits.",
        "operationId": "create_export_job_bulk_export_tables_post",
        "parameters": [
          {
            "name": "dataset_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "From [Post Dataset](https://docs.rippit.com/api-reference/bulk_ingest/post-dataset). Pass this or `table_id`.",
              "title": "Dataset Id"
            },
            "description": "From [Post Dataset](https://docs.rippit.com/api-reference/bulk_ingest/post-dataset). Pass this or `table_id`."
          },
          {
            "name": "table_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "From [list_data_sources](https://docs.rippit.com/api-reference/list_data_sources). Pass this or `dataset_id`.",
              "title": "Table Id"
            },
            "description": "From [list_data_sources](https://docs.rippit.com/api-reference/list_data_sources). Pass this or `dataset_id`."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportQuery"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkJob"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/bulk/jobs/{job_id}": {
      "get": {
        "tags": [
          "bulk"
        ],
        "summary": "Get Job",
        "description": "Returns an upload or export job. Poll until `status` is `done` or `failed`. 404 if the job isn't in your account.",
        "operationId": "get_job_bulk_jobs__job_id__get",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkJob"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BulkJob": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "conversation_blocks",
              "dataset_rows",
              "export"
            ],
            "title": "Kind"
          },
          "status": {
            "type": "string",
            "enum": [
              "awaiting_upload",
              "queued",
              "running",
              "done",
              "failed"
            ],
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DatasetResult"
              },
              {
                "$ref": "#/components/schemas/ConversationResult"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result",
            "description": "Uploads: set once `done`."
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/ExportFile"
            },
            "type": "array",
            "title": "Files",
            "description": "Exports: set once `done`."
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At",
            "description": "Exports: when `files` urls stop working."
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error",
            "description": "Set once `failed`."
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "kind",
          "status",
          "created_at"
        ],
        "title": "BulkJob"
      },
      "ColumnEdit": {
        "properties": {
          "label": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "hidden": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hidden"
          }
        },
        "type": "object",
        "title": "ColumnEdit"
      },
      "ConversationResult": {
        "properties": {
          "rows_received": {
            "type": "integer",
            "title": "Rows Received"
          },
          "rows_written": {
            "type": "integer",
            "title": "Rows Written"
          },
          "rejected": {
            "items": {
              "$ref": "#/components/schemas/RejectedRow"
            },
            "type": "array",
            "title": "Rejected",
            "description": "The first 100 rejected rows."
          },
          "table_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Table Url",
            "description": "Opens the table in Rippit."
          },
          "source": {
            "type": "string",
            "title": "Source",
            "description": "Conversation source the conversations landed in."
          }
        },
        "type": "object",
        "required": [
          "rows_received",
          "rows_written",
          "source"
        ],
        "title": "ConversationResult"
      },
      "ConversationSourceInfo": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "columns": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Columns",
            "description": "searchable keys. New keys in later uploads are added. Null until the first upload."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "table_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Table Url",
            "description": "Opens the table in Rippit. Null until the first upload."
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "columns",
          "created_at",
          "table_url"
        ],
        "title": "ConversationSourceInfo"
      },
      "ConversationSourceInit": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "description": "Where the conversations come from, e.g. `in-app chat`. Pass it as `source` on uploads."
          },
          "description": {
            "type": "string",
            "maxLength": 2000,
            "title": "Description",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "ConversationSourceInit"
      },
      "ConversationSourceInitResult": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "status": {
            "type": "string",
            "enum": [
              "created",
              "exists"
            ],
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "name",
          "status"
        ],
        "title": "ConversationSourceInitResult"
      },
      "DatasetColumn": {
        "properties": {
          "column": {
            "type": "string",
            "maxLength": 128,
            "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
            "title": "Column"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Column type: int / float / string / bool / datetime / list<element: …>."
          }
        },
        "type": "object",
        "required": [
          "column",
          "type"
        ],
        "title": "DatasetColumn"
      },
      "DatasetEdit": {
        "properties": {
          "label": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Label",
            "description": "New display name for the table."
          },
          "columns": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ColumnEdit"
            },
            "type": "object",
            "title": "Columns",
            "description": "Per column: new `label` and/or `hidden`."
          },
          "conversation_link_column": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Link Column",
            "description": "Column holding conversation_ids; clicking a value opens that conversation. Replaces any previous link column."
          },
          "active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active",
            "description": "false hides the table from list_data_sources by default (includeInactive shows it); the next upload sets it back to true."
          }
        },
        "type": "object",
        "title": "DatasetEdit"
      },
      "DatasetInfo": {
        "properties": {
          "dataset_id": {
            "type": "integer",
            "title": "Dataset Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "Display name in Rippit. Defaults to `name`."
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "pkey_cols": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Pkey Cols"
          },
          "append_only_dataset": {
            "type": "boolean",
            "title": "Append Only Dataset"
          },
          "updated_at_col": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At Col"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "table_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Table Url",
            "description": "Opens the table in Rippit."
          }
        },
        "type": "object",
        "required": [
          "dataset_id",
          "name",
          "label",
          "description",
          "pkey_cols",
          "append_only_dataset",
          "updated_at_col",
          "created_at",
          "table_url"
        ],
        "title": "DatasetInfo"
      },
      "DatasetInit": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "description": "Any label, e.g. `Accounts (billing)`."
          },
          "description": {
            "type": "string",
            "maxLength": 2000,
            "title": "Description",
            "description": "What the table holds, shown in Rippit.",
            "default": ""
          },
          "columns": {
            "items": {
              "$ref": "#/components/schemas/DatasetColumn"
            },
            "type": "array",
            "minItems": 1,
            "title": "Columns"
          },
          "pkey_cols": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Pkey Cols",
            "description": "Columns that identify a row; re-uploads replace matching rows."
          },
          "append_only_dataset": {
            "type": "boolean",
            "title": "Append Only Dataset",
            "description": "Required when `pkey_cols` is empty: every uploaded row is kept.",
            "default": false
          },
          "updated_at_col": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At Col"
          },
          "mode": {
            "type": "string",
            "enum": [
              "adhoc",
              "ongoing"
            ],
            "title": "Mode",
            "description": "adhoc = one-off dump, ongoing = cron upserts.",
            "default": "ongoing"
          }
        },
        "type": "object",
        "required": [
          "name",
          "columns"
        ],
        "title": "DatasetInit"
      },
      "DatasetInitResult": {
        "properties": {
          "dataset_id": {
            "type": "integer",
            "title": "Dataset Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "created",
              "exists"
            ],
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "dataset_id",
          "status"
        ],
        "title": "DatasetInitResult"
      },
      "DatasetResult": {
        "properties": {
          "rows_received": {
            "type": "integer",
            "title": "Rows Received"
          },
          "rows_written": {
            "type": "integer",
            "title": "Rows Written"
          },
          "rejected": {
            "items": {
              "$ref": "#/components/schemas/RejectedRow"
            },
            "type": "array",
            "title": "Rejected",
            "description": "The first 100 rejected rows."
          },
          "table_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Table Url",
            "description": "Opens the table in Rippit."
          },
          "dataset_id": {
            "type": "integer",
            "title": "Dataset Id",
            "description": "Dataset the rows landed in."
          }
        },
        "type": "object",
        "required": [
          "rows_received",
          "rows_written",
          "dataset_id"
        ],
        "title": "DatasetResult"
      },
      "ExportFile": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Presigned S3 GET."
          },
          "bytes": {
            "type": "integer",
            "title": "Bytes"
          }
        },
        "type": "object",
        "required": [
          "url",
          "bytes"
        ],
        "title": "ExportFile"
      },
      "ExportQuery": {
        "properties": {
          "select": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/WorkspaceField"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Select",
            "description": "Columns, each optionally with `agg` (count, count_distinct, sum, avg, min, max) and `alias`. Leave out for every column."
          },
          "where": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Where",
            "description": "RipQL subset: `col op literal` with AND / OR, e.g. `n > 1 AND tier IN ('a', 'b')`."
          },
          "group_by": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Group By",
            "default": []
          },
          "order_by": {
            "items": {
              "prefixItems": [
                {
                  "type": "string"
                },
                {
                  "type": "boolean"
                }
              ],
              "type": "array",
              "maxItems": 2,
              "minItems": 2
            },
            "type": "array",
            "title": "Order By",
            "description": "`[column or alias, ascending]` pairs.",
            "default": []
          },
          "limit": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Limit",
            "description": "Leave out for every row."
          },
          "format": {
            "type": "string",
            "enum": [
              "parquet",
              "csv"
            ],
            "title": "Format",
            "description": "csv is gzipped.",
            "default": "parquet"
          }
        },
        "type": "object",
        "title": "ExportQuery"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "RejectedRow": {
        "properties": {
          "row": {
            "type": "integer",
            "title": "Row",
            "description": "0-based line or row index in the upload."
          },
          "error": {
            "type": "string",
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "row",
          "error"
        ],
        "title": "RejectedRow"
      },
      "Upload": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "upload_url": {
            "type": "string",
            "title": "Upload Url",
            "description": "Presigned S3 POST. Send `requests.post(upload_url, data=upload_fields, files={'file': f})`."
          },
          "upload_fields": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Upload Fields",
            "description": "Form fields that must go with the file, unchanged."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "max_bytes": {
            "type": "integer",
            "title": "Max Bytes",
            "description": "S3 rejects larger files with 400 EntityTooLarge.",
            "default": 134217728
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "upload_url",
          "upload_fields",
          "expires_at"
        ],
        "title": "Upload"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "WorkspaceField": {
        "properties": {
          "field": {
            "type": "string",
            "title": "Field"
          },
          "agg": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "sum",
                  "avg",
                  "max",
                  "min",
                  "count",
                  "count_distinct",
                  "stddev_pop",
                  "stddev_samp"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Agg"
          },
          "date_trunc": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "minute",
                  "hour",
                  "day",
                  "week",
                  "month",
                  "year"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Date Trunc"
          },
          "alias": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Alias"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "field"
        ],
        "title": "WorkspaceField"
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "bearer": []
    }
  ]
}
