{
  "openapi": "3.1.0",
  "info": {
    "title": "Streamkap REST API",
    "version": "0.1.0"
  },
  "components": {
    "securitySchemes": {
      "FronteggHTTPAuthentication": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.streamkap.com"
    }
  ],
  "paths": {
    "/sources/snapshot": {
      "post": {
        "tags": [
          "sources"
        ],
        "summary": "Execute Snapshot",
        "description": "Execute a snapshot for the specified source with configurable snapshot type.\n\nThis unified endpoint supports both incremental and blocking snapshots:\n\n**Incremental** (default):\n- Uses watermarking to capture data in chunks while streaming continues\n- Supports `additional_conditions` for filtered snapshots\n- Requires tables to have primary keys\n\n**Blocking**:\n- Pauses streaming during the snapshot operation\n- Required for keyless tables\n- Faster for large tables but blocks streaming until complete\n- Filters (additional_conditions) are not supported\n\nFor stopping/cancelling snapshots, use the `/sources/cancel_snapshot` endpoint which auto-detects the running snapshot type.",
        "operationId": "snapshot_sources_snapshot_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "source_id": {
                    "type": "string",
                    "title": "Source Id",
                    "description": "The ID of the source to snapshot"
                  },
                  "topic_names": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "title": "Topic Names",
                    "description": "Optional list of topic names to snapshot. If not provided, all topics will be snapshotted."
                  },
                  "additional_conditions": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "object",
                          "properties": {
                            "data_collection": {
                              "type": "string",
                              "description": "The data collection (table) name"
                            },
                            "filter": {
                              "type": "string",
                              "description": "The filter condition (SQL WHERE clause or JSON filter)"
                            }
                          }
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "title": "Additional Conditions",
                    "description": "Optional filter conditions for filtered snapshots (incremental only)"
                  },
                  "snapshot_type": {
                    "type": "string",
                    "enum": ["incremental", "blocking"],
                    "default": "incremental",
                    "title": "Snapshot Type",
                    "description": "Type of snapshot to execute. 'incremental' (default) uses watermarking with streaming continuing. 'blocking' pauses streaming during the snapshot."
                  }
                },
                "additionalProperties": true,
                "type": "object",
                "required": [
                  "source_id"
                ],
                "title": "UnifiedSnapshotBody",
                "description": "Unified Snapshot Request Body",
                "x-readme-ref-name": "UnifiedSnapshotBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "detail": {
                      "items": {
                        "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",
                        "x-readme-ref-name": "ValidationError"
                      },
                      "type": "array",
                      "title": "Detail"
                    }
                  },
                  "type": "object",
                  "title": "HTTPValidationError",
                  "x-readme-ref-name": "HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "FronteggHTTPAuthentication": []
          }
        ]
      }
    }
  }
}
