{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rippit-com/json-schema/rippit-com-bulk-job-schema.json",
  "title": "BulkJob",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rippit-com-bulk-openapi.json#/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": "#/$defs/DatasetResult"
        },
        {
          "$ref": "#/$defs/ConversationResult"
        },
        {
          "type": "null"
        }
      ],
      "title": "Result",
      "description": "Uploads: set once `done`."
    },
    "files": {
      "items": {
        "$ref": "#/$defs/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"
  ],
  "$defs": {
    "ConversationResult": {
      "properties": {
        "rows_received": {
          "type": "integer",
          "title": "Rows Received"
        },
        "rows_written": {
          "type": "integer",
          "title": "Rows Written"
        },
        "rejected": {
          "items": {
            "$ref": "#/$defs/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"
    },
    "DatasetResult": {
      "properties": {
        "rows_received": {
          "type": "integer",
          "title": "Rows Received"
        },
        "rows_written": {
          "type": "integer",
          "title": "Rows Written"
        },
        "rejected": {
          "items": {
            "$ref": "#/$defs/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"
    },
    "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"
    }
  }
}