{
  "swagger": "2.0",
  "info": {
    "title": "TiDB Cloud Premium Open API",
    "description": "TiDB Cloud Premium Open API",
    "version": "v1beta2"
  },
  "tags": [
    {
      "name": "ChangefeedService",
      "description": "Service for managing TiDB Premium Changefeed"
    }
  ],
  "host": "cloud.tidbapi.com",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/v1beta2/changefeeds": {
      "get": {
        "summary": "List changefeeds",
        "description": "Lists the changefeeds for a TiDB instance. Results can be filtered by downstream type and paginated using the page token.",
        "operationId": "ListChangefeeds",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2ListChangefeedsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB instance to list changefeeds for.",
            "in": "query",
            "required": true,
            "type": "string",
            "x-example": "1234567890123"
          },
          {
            "name": "downstreamType",
            "description": "Filter by downstream type. If not specified, returns all types.\nExample: KAFKA\n\nThe downstream type to filter by. When not specified, returns all types.\n\n- `\"KAFKA\"`: Apache Kafka\n\n- `\"MYSQL\"`: MySQL-compatible database\n\n- `\"S3\"`: Amazon S3 or S3-compatible storage\n\n - DOWNSTREAM_TYPE_UNSPECIFIED: Default value. Should not be used.\n - KAFKA: Apache Kafka.\n - MYSQL: MySQL-compatible database.\n - S3: Amazon S3 or S3-compatible storage.",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "DOWNSTREAM_TYPE_UNSPECIFIED",
              "KAFKA",
              "MYSQL",
              "S3"
            ],
            "default": "DOWNSTREAM_TYPE_UNSPECIFIED",
            "x-example": "KAFKA"
          },
          {
            "name": "pageSize",
            "description": "The maximum number of changefeeds to return. The default value is 20.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32",
            "x-example": 20
          },
          {
            "name": "pageToken",
            "description": "The page token from a previous ListChangefeeds response, used to retrieve the next page.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      },
      "post": {
        "summary": "Create a changefeed",
        "description": "Creates a new changefeed for replicating data to a downstream system.\n\nFor S3-compatible storage, Alibaba Cloud OSS is supported through the S3-compatible endpoint. To use Alibaba Cloud OSS, set `downstreamType` to `S3`, set `provider` to `ALIBABA_OSS`, and configure the S3 endpoint with a `s3://{bucket_name}/{prefix}/` URI, a regional custom endpoint such as `https://s3.oss-{region_id}.aliyuncs.com`, and `S3_AUTH_TYPE_AK_SK` authentication.\n\nCurrently, Alibaba Cloud OSS only supports Access Key / Secret Key authentication. IAM Assume Role authentication is not supported.",
        "operationId": "CreateChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2Changefeed"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "description": "The request for creating a changefeed.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1beta2CreateChangefeedRequest"
            }
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/v1beta2/changefeeds/{changefeedId}": {
      "get": {
        "summary": "Get a changefeed",
        "description": "Gets the details of a changefeed by its ID, including its state, configuration, and checkpoint information.",
        "operationId": "GetChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2Changefeed"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "changefeedId",
            "description": "The ID of the changefeed to retrieve.",
            "in": "path",
            "required": true,
            "type": "string",
            "x-example": "67890"
          },
          {
            "name": "invalidateCache",
            "description": "Indicates whether to bypass the cache and return the real-time checkpoint information.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "x-example": true
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      },
      "delete": {
        "summary": "Delete a changefeed",
        "description": "Deletes a changefeed by its ID. This operation cannot be undone. The changefeed must be in a deletable state.",
        "operationId": "DeleteChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "changefeedId",
            "description": "The ID of the changefeed to delete.",
            "in": "path",
            "required": true,
            "type": "string",
            "x-example": "67890"
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/v1beta2/changefeeds/{changefeedId}:editDownstreamConfig": {
      "post": {
        "summary": "Edit changefeed downstream configuration",
        "description": "Updates the mutable configuration of an existing changefeed. The changefeed must be in the PAUSED state.",
        "operationId": "EditChangefeedDownstreamConfig",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2Changefeed"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "changefeedId",
            "description": "The ID of the changefeed to update.",
            "in": "path",
            "required": true,
            "type": "string",
            "x-example": "67890"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ChangefeedServiceEditChangefeedDownstreamConfigBody"
            }
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/v1beta2/changefeeds/{changefeedId}:pause": {
      "post": {
        "summary": "Pause a changefeed",
        "description": "Pauses a running changefeed. While paused, the changefeed stops replicating data but retains its configuration and checkpoint.",
        "operationId": "PauseChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "changefeedId",
            "description": "The ID of the changefeed to pause.",
            "in": "path",
            "required": true,
            "type": "string",
            "x-example": "67890"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ChangefeedServicePauseChangefeedBody"
            }
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/v1beta2/changefeeds/{changefeedId}:resume": {
      "post": {
        "summary": "Resume a changefeed",
        "description": "Resumes a paused changefeed. The changefeed continues replicating data from its last checkpoint.",
        "operationId": "ResumeChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "changefeedId",
            "description": "The ID of the changefeed to resume.",
            "in": "path",
            "required": true,
            "type": "string",
            "x-example": "67890"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ChangefeedServiceResumeChangefeedBody"
            }
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/v1beta2/changefeeds/{changefeedId}:scale": {
      "post": {
        "summary": "Scale a changefeed",
        "description": "Scales a changefeed to a different changefeed capacity (CCU). The new capacity takes effect after the operation completes.",
        "operationId": "ScaleChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2Changefeed"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "changefeedId",
            "description": "The ID of the changefeed to scale.",
            "in": "path",
            "required": true,
            "type": "string",
            "x-example": "67890"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ChangefeedServiceScaleChangefeedBody"
            }
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/v1beta2/changefeeds:listCCUs": {
      "get": {
        "summary": "List changefeed CCU options",
        "description": "Lists the available changefeed CCU options that can be selected for a changefeed.",
        "operationId": "ListChangefeedCapacityUnits",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2ListCCUsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "ChangefeedService"
        ]
      }
    }
  },
  "definitions": {
    "AvroConfigBigintUnsignedHandlingMode": {
      "type": "string",
      "enum": [
        "BIGINT_UNSIGNED_HANDLING_MODE_LONG",
        "BIGINT_UNSIGNED_HANDLING_MODE_STRING"
      ],
      "default": "BIGINT_UNSIGNED_HANDLING_MODE_LONG",
      "description": "BigintUnsignedHandlingMode defines how BIGINT UNSIGNED values are handled.\n\n - BIGINT_UNSIGNED_HANDLING_MODE_LONG: Use 64-bit integer (may overflow for very large values).\n - BIGINT_UNSIGNED_HANDLING_MODE_STRING: Use string representation (safe for all values)."
    },
    "AvroConfigDecimalHandlingMode": {
      "type": "string",
      "enum": [
        "DECIMAL_HANDLING_MODE_UNSPECIFIED",
        "DECIMAL_HANDLING_MODE_PRECISE",
        "DECIMAL_HANDLING_MODE_STRING"
      ],
      "default": "DECIMAL_HANDLING_MODE_UNSPECIFIED",
      "description": "DecimalHandlingMode defines how decimal values are serialized.\n\n - DECIMAL_HANDLING_MODE_PRECISE: Use precise decimal representation.\n - DECIMAL_HANDLING_MODE_STRING: Use string representation."
    },
    "AvroConfigSchemaRegistry": {
      "type": "object",
      "properties": {
        "schemaRegistryEndpoints": {
          "type": "string",
          "example": "http://schema-registry:8081",
          "description": "The comma-separated list of Schema Registry endpoints. Required for Confluent Schema Registry."
        },
        "enableBasicAuth": {
          "type": "boolean",
          "example": true,
          "description": "Indicates whether to enable HTTP basic authentication for Schema Registry."
        },
        "basicAuthUsername": {
          "type": "string",
          "example": "schema_user",
          "description": "The basic authentication username for Schema Registry."
        },
        "basicAuthPassword": {
          "type": "string",
          "example": "********",
          "description": "The basic authentication password for Schema Registry."
        }
      },
      "description": "The Schema Registry connection configuration."
    },
    "ChangefeedServiceEditChangefeedDownstreamConfigBody": {
      "type": "object",
      "properties": {
        "dryRun": {
          "type": "boolean",
          "example": true,
          "description": "Indicates whether to run dry-run validation only without applying the update."
        },
        "tableConfig": {
          "description": "The updated table filtering and event filter configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TableConfig"
            }
          ]
        },
        "downstreamType": {
          "example": "KAFKA",
          "description": "The downstream type for a changefeed. Must match the existing downstream type (cannot be changed).",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2DownstreamType"
            }
          ]
        },
        "kafka": {
          "description": "The updated Kafka downstream configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2KafkaDownstreamConfig"
            }
          ]
        },
        "mysql": {
          "description": "The updated MySQL downstream configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2MySQLDownstreamConfig"
            }
          ]
        },
        "s3": {
          "description": "The updated S3 downstream configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2S3DownstreamConfig"
            }
          ]
        }
      },
      "description": "The request for updating a changefeed downstream configuration.",
      "required": [
        "downstreamType"
      ]
    },
    "ChangefeedServicePauseChangefeedBody": {
      "type": "object",
      "description": "The request for pausing a changefeed."
    },
    "ChangefeedServiceResumeChangefeedBody": {
      "type": "object",
      "description": "The request for resuming a changefeed."
    },
    "ChangefeedServiceScaleChangefeedBody": {
      "type": "object",
      "properties": {
        "changefeedCapacity": {
          "type": "string",
          "example": "8ccu",
          "description": "The target changefeed capacity (CCU) to scale to. Call ListChangefeedCapacityUnits to get the available CCU options."
        }
      },
      "description": "The request for scaling a changefeed.",
      "required": [
        "changefeedCapacity"
      ]
    },
    "ChangefeedState": {
      "type": "string",
      "enum": [
        "STATE_UNSPECIFIED",
        "RUNNING",
        "FAILED",
        "ERROR",
        "CREATING",
        "PAUSING",
        "PAUSED",
        "DELETING",
        "DELETED",
        "EDITING",
        "WARNING",
        "SCALING",
        "RESUMING"
      ],
      "default": "STATE_UNSPECIFIED",
      "description": "State defines the possible states of a changefeed.\n\n - STATE_UNSPECIFIED: Default value. Should not be used.\n - RUNNING: Changefeed is actively replicating data.\n - FAILED: Changefeed encountered a fatal error and stopped.\n - ERROR: Changefeed encountered an error but may recover.\n - CREATING: Changefeed is being created.\n - PAUSING: Changefeed is in the process of pausing.\n - PAUSED: Changefeed is paused.\n - DELETING: Changefeed is being deleted.\n - DELETED: Changefeed has been deleted.\n - EDITING: Changefeed configuration is being updated.\n - WARNING: Changefeed is running but has warnings.\n - SCALING: Changefeed is being scaled.\n - RESUMING: Changefeed is being resumed."
    },
    "DataFormatAvroConfig": {
      "type": "object",
      "properties": {
        "decimalHandlingMode": {
          "example": "DECIMAL_HANDLING_MODE_PRECISE",
          "description": "The decimal serialization mode.\n\n- `\"DECIMAL_HANDLING_MODE_UNSPECIFIED\"`: Default value.\n\n- `\"DECIMAL_HANDLING_MODE_PRECISE\"`: Use precise decimal representation.\n\n- `\"DECIMAL_HANDLING_MODE_STRING\"`: Use string representation.",
          "allOf": [
            {
              "$ref": "#/definitions/AvroConfigDecimalHandlingMode"
            }
          ]
        },
        "bigintUnsignedHandlingMode": {
          "example": "BIGINT_UNSIGNED_HANDLING_MODE_STRING",
          "description": "The handling mode for BIGINT UNSIGNED values.\n\n- `\"BIGINT_UNSIGNED_HANDLING_MODE_LONG\"`: Use 64-bit integer (may overflow for very large values).\n\n- `\"BIGINT_UNSIGNED_HANDLING_MODE_STRING\"`: Use string representation (safe for all values).",
          "allOf": [
            {
              "$ref": "#/definitions/AvroConfigBigintUnsignedHandlingMode"
            }
          ]
        },
        "schemaRegistry": {
          "description": "The Schema Registry connection configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/AvroConfigSchemaRegistry"
            }
          ]
        }
      },
      "description": "The Avro-specific data format configuration."
    },
    "DataFormatDebeziumConfig": {
      "type": "object",
      "properties": {
        "outputOldValue": {
          "type": "boolean",
          "example": true,
          "description": "Indicates whether to output the old value before the change."
        },
        "disableSchema": {
          "type": "boolean",
          "example": false,
          "description": "Indicates whether to disable the schema in Debezium messages."
        }
      },
      "description": "The Debezium-specific data format configuration."
    },
    "EndpointProvider": {
      "type": "string",
      "enum": [
        "PROVIDER_UNSPECIFIED",
        "AWS",
        "ALIBABA_OSS"
      ],
      "default": "PROVIDER_UNSPECIFIED",
      "description": "Provider defines the S3-compatible object storage provider.\n\n - PROVIDER_UNSPECIFIED: Default value. Uses AWS S3 behavior.\n - AWS: Amazon S3.\n - ALIBABA_OSS: Alibaba Cloud OSS through its S3-compatible endpoint."
    },
    "EndpointS3AuthType": {
      "type": "string",
      "enum": [
        "S3_AUTH_TYPE_UNSPECIFIED",
        "S3_AUTH_TYPE_AK_SK",
        "S3_AUTH_TYPE_ASSUME_ROLE"
      ],
      "default": "S3_AUTH_TYPE_UNSPECIFIED",
      "description": "S3AuthType defines the supported S3 authentication types.\n\n - S3_AUTH_TYPE_AK_SK: Access Key / Secret Key authentication.\n - S3_AUTH_TYPE_ASSUME_ROLE: IAM Assume Role authentication."
    },
    "KafkaDownstreamConfigBroker": {
      "type": "object",
      "properties": {
        "version": {
          "example": "KAFKA_VERSION_3XX",
          "description": "The Kafka broker version.\n\n- `\"KAFKA_VERSION_UNSPECIFIED\"`: Default value. Must not be used.\n\n- `\"KAFKA_VERSION_1XX\"`: Kafka 1.x\n\n- `\"KAFKA_VERSION_2XX\"`: Kafka 2.x\n\n- `\"KAFKA_VERSION_3XX\"`: Kafka 3.x",
          "allOf": [
            {
              "$ref": "#/definitions/KafkaDownstreamConfigKafkaVersion"
            }
          ]
        },
        "brokerEndpoints": {
          "type": "string",
          "example": "broker1:9092,broker2:9092,broker3:9092",
          "description": "The comma-separated list of Kafka broker addresses. Required for PUBLIC and VPC_PEERING network types. For PRIVATE_LINK, this field can be omitted; the server assembles broker endpoints from `networkInfo.sinkEndpointId` and `networkInfo.ports`."
        },
        "useTls": {
          "type": "boolean",
          "example": true,
          "description": "Indicates whether to use TLS for the Kafka connection. The default value is false."
        },
        "insecureSkipVerify": {
          "type": "boolean",
          "example": false,
          "description": "Indicates whether to skip TLS certificate verification. The default value is false. Only enable this field for testing with self-signed certificates."
        },
        "compression": {
          "example": "LZ4",
          "description": "The Kafka message compression type.\n\n- `\"COMPRESSION_TYPE_UNSPECIFIED\"`: Default value.\n\n- `\"NONE\"`: No compression.\n\n- `\"GZIP\"`: GZIP compression.\n\n- `\"SNAPPY\"`: Snappy compression.\n\n- `\"LZ4\"`: LZ4 compression.\n\n- `\"ZSTD\"`: ZSTD compression.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2KafkaDownstreamConfigCompressionType"
            }
          ]
        },
        "kafkaClientId": {
          "type": "string",
          "example": "my-changefeed-client",
          "description": "The optional Kafka client ID. When left empty, a system default is used."
        }
      },
      "description": "The Kafka broker connection configuration.",
      "required": [
        "version"
      ]
    },
    "KafkaDownstreamConfigColumnSelector": {
      "type": "object",
      "properties": {
        "matcher": {
          "type": "array",
          "example": [
            "mydb.orders",
            "mydb.user_*"
          ],
          "items": {
            "type": "string"
          },
          "description": "The table name patterns to match for column selection."
        },
        "columns": {
          "type": "array",
          "example": [
            "id",
            "name",
            "status"
          ],
          "items": {
            "type": "string"
          },
          "description": "The column names to include for the matched tables."
        }
      },
      "description": "The column filtering configuration for specific tables."
    },
    "KafkaDownstreamConfigKafkaVersion": {
      "type": "string",
      "enum": [
        "KAFKA_VERSION_UNSPECIFIED",
        "KAFKA_VERSION_1XX",
        "KAFKA_VERSION_2XX",
        "KAFKA_VERSION_3XX"
      ],
      "default": "KAFKA_VERSION_UNSPECIFIED",
      "description": "KafkaVersion defines supported Kafka broker versions.\n\n - KAFKA_VERSION_1XX: Kafka 1.x\n - KAFKA_VERSION_2XX: Kafka 2.x\n - KAFKA_VERSION_3XX: Kafka 3.x"
    },
    "KafkaDownstreamConfigTopicPartitionConfig": {
      "type": "object",
      "properties": {
        "dispatchType": {
          "example": "DISPATCH_TYPE_BY_TABLE",
          "description": "The message dispatch type to topics.\n\n- `\"DISPATCH_TYPE_UNSPECIFIED\"`: Default value.\n\n- `\"DISPATCH_TYPE_ONE_TOPIC\"`: All messages go to a single topic.\n\n- `\"DISPATCH_TYPE_BY_TABLE\"`: Each table gets its own topic.\n\n- `\"DISPATCH_TYPE_BY_DATABASE\"`: Each database gets its own topic.",
          "allOf": [
            {
              "$ref": "#/definitions/TopicPartitionConfigDispatchType"
            }
          ]
        },
        "defaultTopic": {
          "type": "string",
          "example": "cdc-events",
          "description": "The default topic for dispatching all messages when dispatchType is DISPATCH_TYPE_ONE_TOPIC."
        },
        "topicPrefix": {
          "type": "string",
          "example": "cdc-",
          "description": "The topic name prefix for dispatch types that create per-table or per-database topics."
        },
        "separator": {
          "type": "string",
          "example": ".",
          "description": "The separator between the prefix and the table or database name."
        },
        "topicSuffix": {
          "type": "string",
          "example": "-v1",
          "description": "The topic name suffix for dispatch types that create per-table or per-database topics."
        },
        "replicationFactor": {
          "type": "integer",
          "format": "int64",
          "example": 3,
          "description": "The replication factor for auto-created topics.",
          "minimum": 1
        },
        "partitionNum": {
          "type": "integer",
          "format": "int64",
          "example": 6,
          "description": "The number of partitions for auto-created topics.",
          "minimum": 1
        },
        "partitionDispatchers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TopicPartitionConfigPartitionDispatcherConfig"
          },
          "description": "The custom partition dispatcher configurations."
        }
      },
      "description": "The Kafka topic and partition configuration.",
      "required": [
        "dispatchType",
        "replicationFactor",
        "partitionNum"
      ]
    },
    "NetworkInfoNetworkType": {
      "type": "string",
      "enum": [
        "NETWORK_TYPE_UNSPECIFIED",
        "NETWORK_TYPE_PUBLIC",
        "NETWORK_TYPE_VPC_PEERING",
        "NETWORK_TYPE_PRIVATE_LINK"
      ],
      "default": "NETWORK_TYPE_UNSPECIFIED",
      "description": "The network type for downstream connectivity.\n\n - NETWORK_TYPE_UNSPECIFIED: Default value.\n - NETWORK_TYPE_PUBLIC: Public internet access.\n - NETWORK_TYPE_VPC_PEERING: AWS VPC Peering.\n - NETWORK_TYPE_PRIVATE_LINK: Private endpoint connectivity managed by TiDB Cloud."
    },
    "S3DataFormatBinaryEncodingMethod": {
      "type": "string",
      "enum": [
        "BINARY_ENCODING_METHOD_UNSPECIFIED",
        "BASE64",
        "HEX"
      ],
      "default": "BINARY_ENCODING_METHOD_UNSPECIFIED",
      "description": "BinaryEncodingMethod defines how binary values are encoded.\n\n - BASE64: Base64 encoding.\n - HEX: Hexadecimal encoding."
    },
    "S3DataFormatDateSeparator": {
      "type": "string",
      "enum": [
        "DATE_SEPARATOR_UNSPECIFIED",
        "NONE",
        "YEAR",
        "MONTH",
        "DAY"
      ],
      "default": "DATE_SEPARATOR_UNSPECIFIED",
      "description": "DateSeparator defines the date separator options for directory structure.\n\n - NONE: No date separator.\n - YEAR: Separate by year.\n - MONTH: Separate by month.\n - DAY: Separate by day."
    },
    "TopicPartitionConfigDispatchType": {
      "type": "string",
      "enum": [
        "DISPATCH_TYPE_UNSPECIFIED",
        "DISPATCH_TYPE_ONE_TOPIC",
        "DISPATCH_TYPE_BY_TABLE",
        "DISPATCH_TYPE_BY_DATABASE"
      ],
      "default": "DISPATCH_TYPE_UNSPECIFIED",
      "description": "DispatchType defines how messages are dispatched to topics.\n\n - DISPATCH_TYPE_ONE_TOPIC: All messages go to a single topic.\n - DISPATCH_TYPE_BY_TABLE: Each table gets its own topic.\n - DISPATCH_TYPE_BY_DATABASE: Each database gets its own topic."
    },
    "TopicPartitionConfigPartitionDispatcher": {
      "type": "string",
      "enum": [
        "PARTITION_DISPATCHER_UNSPECIFIED",
        "TABLE",
        "INDEX_VALUE",
        "TIMESTAMP",
        "COLUMNS"
      ],
      "default": "PARTITION_DISPATCHER_UNSPECIFIED",
      "description": "PartitionDispatcher defines the partition dispatch strategies.\n\n - TABLE: Dispatch by table name.\n - INDEX_VALUE: Dispatch by index value.\n - TIMESTAMP: Dispatch by timestamp.\n - COLUMNS: Dispatch by column values."
    },
    "TopicPartitionConfigPartitionDispatcherConfig": {
      "type": "object",
      "properties": {
        "partitionType": {
          "example": "TABLE",
          "description": "The partition dispatch strategy.\n\n- `\"PARTITION_DISPATCHER_UNSPECIFIED\"`: Default value.\n\n- `\"TABLE\"`: Dispatch by table name.\n\n- `\"INDEX_VALUE\"`: Dispatch by index value.\n\n- `\"TIMESTAMP\"`: Dispatch by timestamp.\n\n- `\"COLUMNS\"`: Dispatch by column values.",
          "allOf": [
            {
              "$ref": "#/definitions/TopicPartitionConfigPartitionDispatcher"
            }
          ]
        },
        "matcher": {
          "type": "array",
          "example": [
            "mydb.orders"
          ],
          "items": {
            "type": "string"
          },
          "description": "The table name patterns to match for the dispatcher."
        },
        "indexName": {
          "type": "string",
          "example": "primary",
          "description": "The index name for the INDEX_VALUE partition dispatcher."
        },
        "columns": {
          "type": "array",
          "example": [
            "user_id",
            "order_id"
          ],
          "items": {
            "type": "string"
          },
          "description": "The column names for the COLUMNS partition dispatcher."
        }
      },
      "description": "The custom partition dispatcher configuration.",
      "required": [
        "partitionType",
        "matcher"
      ]
    },
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    },
    "v1beta2Changefeed": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "67890",
          "description": "The system-generated unique identifier of the changefeed.",
          "readOnly": true
        },
        "tidbId": {
          "type": "string",
          "example": "1234567890123",
          "description": "The ID of the source TiDB instance."
        },
        "name": {
          "type": "string",
          "example": "my-kafka-changefeed",
          "description": "The user-defined name for the changefeed. Must be unique within the TiDB instance."
        },
        "networkInfo": {
          "description": "The network configuration for connecting to the downstream. Required for Kafka and MySQL downstream types.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2NetworkInfo"
            }
          ]
        },
        "state": {
          "example": "RUNNING",
          "description": "The current state of the changefeed.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/ChangefeedState"
            }
          ]
        },
        "createTime": {
          "type": "string",
          "format": "date-time",
          "example": "2026-06-08T10:30:00Z",
          "description": "The creation time of the changefeed.",
          "readOnly": true
        },
        "checkpointTso": {
          "type": "string",
          "format": "uint64",
          "example": "452348901234567890",
          "description": "The checkpoint TSO of the changefeed, representing the last successfully replicated timestamp.",
          "readOnly": true
        },
        "checkpointTs": {
          "type": "string",
          "format": "date-time",
          "example": "2026-06-08T10:35:00Z",
          "description": "The human-readable checkpoint timestamp of the changefeed.",
          "readOnly": true
        },
        "changefeedCapacity": {
          "type": "string",
          "example": "4ccu",
          "description": "The changefeed capacity (CCU) of the changefeed. Call ListChangefeedCapacityUnits to get the available CCU options."
        },
        "downstreamType": {
          "example": "KAFKA",
          "description": "The downstream type for a changefeed. When a downstream type is specified, the corresponding configuration field is required. Cannot be changed after creation.\n\n- `\"KAFKA\"`: Apache Kafka\n\n- `\"MYSQL\"`: MySQL-compatible database\n\n- `\"S3\"`: Amazon S3 or S3-compatible storage",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2DownstreamType"
            }
          ]
        },
        "tableConfig": {
          "description": "The table filtering and event filter configuration. This field is editable only when the changefeed is in PAUSED state.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TableConfig"
            }
          ]
        },
        "startPosition": {
          "description": "The start position configuration. This field can only be set during creation.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2StartPosition"
            }
          ]
        },
        "kafka": {
          "description": "The Kafka downstream configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2KafkaDownstreamConfig"
            }
          ]
        },
        "mysql": {
          "description": "The MySQL downstream configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2MySQLDownstreamConfig"
            }
          ]
        },
        "s3": {
          "description": "The S3 downstream configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2S3DownstreamConfig"
            }
          ]
        },
        "error": {
          "type": "string",
          "example": "kafka: broker not available",
          "description": "The error message when the changefeed is in the FAILED or ERROR state. This field is empty otherwise.",
          "readOnly": true
        }
      },
      "description": "The changefeed configuration.",
      "required": [
        "tidbId",
        "name",
        "changefeedCapacity",
        "downstreamType",
        "tableConfig",
        "startPosition"
      ]
    },
    "v1beta2ChangefeedCCU": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "example": "4ccu",
          "description": "The identifier of the CCU option.",
          "readOnly": true
        },
        "displayName": {
          "type": "string",
          "example": "4 CCU - Small",
          "description": "The human-readable display name of the CCU option.",
          "readOnly": true
        },
        "ccuNum": {
          "type": "integer",
          "format": "int64",
          "example": 4,
          "description": "The number of CCUs (Changefeed Capacity Units).",
          "readOnly": true
        },
        "rpsLimit": {
          "type": "integer",
          "format": "int64",
          "example": 5000,
          "description": "The maximum rows per second for the CCU option. This value is for reference only and may vary by workload.",
          "readOnly": true
        }
      },
      "description": "The changefeed CCU option."
    },
    "v1beta2Connection": {
      "type": "object",
      "properties": {
        "endpoint": {
          "type": "string",
          "example": "mysql.example.com:3306",
          "description": "The MySQL endpoint address in the `host:port` format. Required for PUBLIC and VPC_PEERING networks. For PRIVATE_LINK, this field can be omitted; the server assembles the endpoint from `networkInfo.sinkEndpointId` and `networkInfo.ports`."
        },
        "username": {
          "type": "string",
          "example": "cdc_user",
          "description": "The MySQL username for authentication."
        },
        "password": {
          "type": "string",
          "example": "********",
          "description": "The MySQL password for authentication. This field is input-only and not returned in responses."
        }
      },
      "description": "The MySQL connection configuration.",
      "required": [
        "username"
      ]
    },
    "v1beta2CreateChangefeedRequest": {
      "type": "object",
      "properties": {
        "changefeed": {
          "description": "The changefeed to create. All required fields must be set.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2Changefeed"
            }
          ]
        },
        "dryRun": {
          "type": "boolean",
          "example": true,
          "description": "Indicates whether to run dry-run validation only without creating the changefeed."
        }
      },
      "description": "The request for creating a changefeed.",
      "required": [
        "changefeed"
      ]
    },
    "v1beta2DownstreamType": {
      "type": "string",
      "enum": [
        "DOWNSTREAM_TYPE_UNSPECIFIED",
        "KAFKA",
        "MYSQL",
        "S3"
      ],
      "default": "DOWNSTREAM_TYPE_UNSPECIFIED",
      "description": "The downstream type for a changefeed.\n\n - DOWNSTREAM_TYPE_UNSPECIFIED: Default value. Should not be used.\n - KAFKA: Apache Kafka.\n - MYSQL: MySQL-compatible database.\n - S3: Amazon S3 or S3-compatible storage."
    },
    "v1beta2EventFilter": {
      "type": "object",
      "properties": {
        "tableMatchers": {
          "type": "array",
          "example": [
            "mydb.orders",
            "mydb.user_*"
          ],
          "items": {
            "type": "string"
          },
          "description": "The table name patterns to match. Uses the same syntax as TiCDC table filter. Supports wildcards. Matches database name, so be careful with database-level DDLs."
        },
        "ignoredEvents": {
          "type": "array",
          "example": [
            "insert",
            "delete",
            "alter table"
          ],
          "items": {
            "type": "string"
          },
          "description": "The event types to ignore. Supported values include DML events such as `insert`, `update`, `delete`, and `all dml`, and DDL events such as `create schema`, `drop table`, `alter table`, and `all ddl`. For the complete list of supported values, see [Changefeed Log Filters](https://docs.pingcap.com/tidb/stable/ticdc-filter/)."
        },
        "ignoredSqlStatements": {
          "type": "array",
          "example": [
            "^drop",
            "add column"
          ],
          "items": {
            "type": "string"
          },
          "description": "The SQL statement patterns to ignore. Only applies to DDL statements. Supports regular expressions."
        },
        "ignoredInsertValueExpression": {
          "type": "string",
          "example": "status = 'deleted'",
          "description": "The SQL expression to filter INSERT events by column value. Uses SQL expressions in default SQL mode. All tables matched by `table_matchers` must contain all columns referenced in this expression."
        },
        "ignoredUpdateOldValueExpression": {
          "type": "string",
          "example": "status = 'archived'",
          "description": "The SQL expression to filter UPDATE events by the old column value. Uses SQL expressions in default SQL mode. All tables matched by `table_matchers` must contain all columns referenced in this expression."
        },
        "ignoredUpdateNewValueExpression": {
          "type": "string",
          "example": "status = 'deleted'",
          "description": "The SQL expression to filter UPDATE events by the new column value. Uses SQL expressions in default SQL mode. All tables matched by `table_matchers` must contain all columns referenced in this expression."
        },
        "ignoredDeleteValueExpression": {
          "type": "string",
          "example": "soft_delete = true",
          "description": "The SQL expression to filter DELETE events by column value. Uses SQL expressions in default SQL mode. All tables matched by `table_matchers` must contain all columns referenced in this expression."
        }
      },
      "description": "The event filter configuration for fine-grained control."
    },
    "v1beta2KafkaDownstreamConfig": {
      "type": "object",
      "properties": {
        "broker": {
          "description": "The Kafka broker connection configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/KafkaDownstreamConfigBroker"
            }
          ]
        },
        "authentication": {
          "description": "The Kafka authentication configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2KafkaDownstreamConfigAuthentication"
            }
          ]
        },
        "dataFormat": {
          "description": "The Kafka data format and serialization configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2KafkaDownstreamConfigDataFormat"
            }
          ]
        },
        "topicPartitionConfig": {
          "description": "The Kafka topic and partition configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/KafkaDownstreamConfigTopicPartitionConfig"
            }
          ]
        },
        "columnSelectors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/KafkaDownstreamConfigColumnSelector"
          },
          "description": "The column selectors for filtering specific columns."
        }
      },
      "description": "The Kafka downstream configuration.",
      "required": [
        "broker",
        "authentication",
        "dataFormat",
        "topicPartitionConfig"
      ]
    },
    "v1beta2KafkaDownstreamConfigAuthentication": {
      "type": "object",
      "properties": {
        "authType": {
          "example": "SASL_SCRAM_SHA_256",
          "description": "The Kafka authentication type.\n\n- `\"AUTH_TYPE_UNSPECIFIED\"`: Default value.\n\n- `\"DISABLE\"`: No authentication.\n\n- `\"SASL_PLAIN\"`: SASL/PLAIN authentication.\n\n- `\"SASL_SCRAM_SHA_256\"`: SASL/SCRAM-SHA-256 authentication.\n\n- `\"SASL_SCRAM_SHA_512\"`: SASL/SCRAM-SHA-512 authentication.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2KafkaDownstreamConfigAuthenticationAuthType"
            }
          ]
        },
        "username": {
          "type": "string",
          "example": "kafka_user",
          "description": "The SASL username for Kafka authentication."
        },
        "password": {
          "type": "string",
          "example": "********",
          "description": "The SASL password for Kafka authentication."
        }
      },
      "description": "The Kafka authentication configuration.",
      "required": [
        "authType"
      ]
    },
    "v1beta2KafkaDownstreamConfigAuthenticationAuthType": {
      "type": "string",
      "enum": [
        "AUTH_TYPE_UNSPECIFIED",
        "DISABLE",
        "SASL_PLAIN",
        "SASL_SCRAM_SHA_256",
        "SASL_SCRAM_SHA_512"
      ],
      "default": "AUTH_TYPE_UNSPECIFIED",
      "description": "AuthType defines the supported Kafka authentication types.\n\n - DISABLE: No authentication.\n - SASL_PLAIN: SASL/PLAIN authentication.\n - SASL_SCRAM_SHA_256: SASL/SCRAM-SHA-256 authentication.\n - SASL_SCRAM_SHA_512: SASL/SCRAM-SHA-512 authentication."
    },
    "v1beta2KafkaDownstreamConfigCompressionType": {
      "type": "string",
      "enum": [
        "COMPRESSION_TYPE_UNSPECIFIED",
        "NONE",
        "GZIP",
        "SNAPPY",
        "LZ4",
        "ZSTD"
      ],
      "default": "COMPRESSION_TYPE_UNSPECIFIED",
      "description": "CompressionType defines the compression types for Kafka messages.\n\n - NONE: No compression.\n - GZIP: GZIP compression.\n - SNAPPY: Snappy compression.\n - LZ4: LZ4 compression.\n - ZSTD: ZSTD compression."
    },
    "v1beta2KafkaDownstreamConfigDataFormat": {
      "type": "object",
      "properties": {
        "protocol": {
          "example": "PROTOCOL_CANAL_JSON",
          "description": "The Kafka output protocol.\n\n- `\"PROTOCOL_UNSPECIFIED\"`: Default value.\n\n- `\"PROTOCOL_CANAL_JSON\"`: Canal JSON format. Recommended for most use cases.\n\n- `\"PROTOCOL_OPEN_PROTOCOL\"`: Open Protocol (TiDB native format). Encodes multiple events into one message.\n\n- `\"PROTOCOL_AVRO\"`: Apache Avro format.\n\n- `\"PROTOCOL_DEBEZIUM\"`: Debezium JSON format.\n\n- `\"PROTOCOL_DEBEZIUM_AVRO\"`: Debezium events encoded with Avro.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2KafkaDownstreamConfigDataFormatProtocol"
            }
          ]
        },
        "debeziumConfig": {
          "description": "The Debezium-specific data format configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/DataFormatDebeziumConfig"
            }
          ]
        },
        "avroConfig": {
          "description": "The Avro-specific data format configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/DataFormatAvroConfig"
            }
          ]
        },
        "enableTidbExtension": {
          "type": "boolean",
          "example": true,
          "description": "Indicates whether to enable TiDB extension fields. The default value is false. For more information, see https://docs.pingcap.com/tidb/stable/ticdc-avro-protocol."
        },
        "outputRawChangeEvent": {
          "type": "boolean",
          "example": false,
          "description": "Indicates whether to output raw change events. The default value is false. For more information, see https://docs.pingcap.com/tidb/stable/ticdc-split-transaction-by-memory."
        }
      },
      "description": "The Kafka message format and serialization configuration.",
      "required": [
        "protocol"
      ]
    },
    "v1beta2KafkaDownstreamConfigDataFormatProtocol": {
      "type": "string",
      "enum": [
        "PROTOCOL_UNSPECIFIED",
        "PROTOCOL_CANAL_JSON",
        "PROTOCOL_OPEN_PROTOCOL",
        "PROTOCOL_AVRO",
        "PROTOCOL_DEBEZIUM",
        "PROTOCOL_DEBEZIUM_AVRO"
      ],
      "default": "PROTOCOL_UNSPECIFIED",
      "description": "Protocol defines the supported output protocols.\n\n - PROTOCOL_CANAL_JSON: Canal JSON format. Recommended for most use cases.\n - PROTOCOL_OPEN_PROTOCOL: Open Protocol (TiDB native format). Encodes multiple events into one message.\n - PROTOCOL_AVRO: Apache Avro format. Supports Confluent Schema Registry and AWS Glue Schema Registry.\n - PROTOCOL_DEBEZIUM: Debezium format.\n - PROTOCOL_DEBEZIUM_AVRO: Debezium events encoded with Avro."
    },
    "v1beta2ListCCUsResponse": {
      "type": "object",
      "properties": {
        "ccus": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1beta2ChangefeedCCU"
          },
          "description": "The list of available CCU options.",
          "readOnly": true
        }
      },
      "description": "The response for listing changefeed CCU options."
    },
    "v1beta2ListChangefeedsResponse": {
      "type": "object",
      "properties": {
        "changefeeds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1beta2Changefeed"
          },
          "description": "The list of changefeeds matching the query.",
          "readOnly": true
        },
        "totalSize": {
          "type": "integer",
          "format": "int32",
          "example": 42,
          "description": "The total number of changefeeds across all pages.",
          "readOnly": true
        },
        "nextPageToken": {
          "type": "string",
          "example": "eyJpZCI6Njc4OTB9",
          "description": "The page token for the next page. This field is empty when there are no more pages.",
          "readOnly": true
        }
      },
      "description": "The response for listing changefeeds."
    },
    "v1beta2MySQLDownstreamConfig": {
      "type": "object",
      "properties": {
        "connection": {
          "description": "The MySQL connection configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2Connection"
            }
          ]
        }
      },
      "description": "The MySQL downstream configuration.",
      "required": [
        "connection"
      ]
    },
    "v1beta2NetworkInfo": {
      "type": "object",
      "properties": {
        "networkType": {
          "example": "NETWORK_TYPE_PUBLIC",
          "description": "The network type for downstream connectivity.\n\n- `\"NETWORK_TYPE_UNSPECIFIED\"`: Default value.\n\n- `\"NETWORK_TYPE_PUBLIC\"`: Public internet access.\n\n- `\"NETWORK_TYPE_VPC_PEERING\"`: AWS VPC Peering.\n\n- `\"NETWORK_TYPE_PRIVATE_LINK\"`: Private endpoint connectivity managed by TiDB Cloud. Create a private endpoint for the external service in the console UI and assign it to `sinkEndpointId`.",
          "allOf": [
            {
              "$ref": "#/definitions/NetworkInfoNetworkType"
            }
          ]
        },
        "sinkEndpointId": {
          "type": "string",
          "format": "uint64",
          "example": "12345",
          "description": "The ID for the downstream network endpoint for external service. Required when network_type is `NETWORK_TYPE_PRIVATE_LINK`."
        },
        "ports": {
          "type": "array",
          "example": [
            9092
          ],
          "items": {
            "type": "integer",
            "format": "int64"
          },
          "description": "The ports for private endpoint connectivity. Required when networkType is `NETWORK_TYPE_PRIVATE_LINK`. The server uses these ports to construct broker endpoints as `<sink_endpoint_address>:<port>`."
        }
      },
      "description": "The network configuration for downstream connectivity.",
      "required": [
        "networkType"
      ]
    },
    "v1beta2S3DataFormat": {
      "type": "object",
      "properties": {
        "protocol": {
          "example": "PROTOCOL_CANAL_JSON",
          "description": "The output protocol.\n\n- `\"PROTOCOL_UNSPECIFIED\"`: Default value.\n\n- `\"PROTOCOL_CSV\"`: CSV format.\n\n- `\"PROTOCOL_CANAL_JSON\"`: Canal JSON format.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2S3DataFormatProtocol"
            }
          ]
        },
        "terminator": {
          "type": "string",
          "example": "\n",
          "description": "The row terminator used to separate data change events. This configuration is only used for storage sinks. The default value is a newline character (\"\\n\"). When the field is omitted or empty, a newline is used."
        },
        "dateSeparator": {
          "example": "DAY",
          "description": "The date separator for the directory structure.\n\n- `\"DATE_SEPARATOR_UNSPECIFIED\"`: Uses `NONE`.\n\n- `\"NONE\"`: No date separator. This is the default behavior.\n\n- `\"YEAR\"`: Separate by year.\n\n- `\"MONTH\"`: Separate by month.\n\n- `\"DAY\"`: Separate by day.",
          "allOf": [
            {
              "$ref": "#/definitions/S3DataFormatDateSeparator"
            }
          ]
        },
        "enableTidbExtension": {
          "type": "boolean",
          "example": false,
          "description": "Indicates whether to enable TiDB extension fields in Canal-JSON messages. The default value is false."
        },
        "delimiter": {
          "type": "string",
          "example": ",",
          "description": "The field delimiter for CSV files. Required when protocol is `PROTOCOL_CSV`. The value must be an ASCII character."
        },
        "quote": {
          "type": "string",
          "example": "\"",
          "description": "The quotation character for CSV fields. The default value is `\"`. When the value is empty, the default quotation character is retained."
        },
        "null": {
          "type": "string",
          "example": "NULL",
          "description": "The null representation for CSV columns. The default value is `\\N`."
        },
        "includeCommitTs": {
          "type": "boolean",
          "example": false,
          "description": "Indicates whether to include the commit timestamp in CSV rows. The default value is false."
        },
        "binaryEncodingMethod": {
          "example": "BASE64",
          "description": "The binary encoding method.\n\n- `\"BINARY_ENCODING_METHOD_UNSPECIFIED\"`: Default value.\n\n- `\"BASE64\"`: Base64 encoding.\n\n- `\"HEX\"`: Hexadecimal encoding.",
          "allOf": [
            {
              "$ref": "#/definitions/S3DataFormatBinaryEncodingMethod"
            }
          ]
        },
        "outputRawChangeEvent": {
          "type": "boolean",
          "example": false,
          "description": "Indicates whether to output raw change events. The default value is false. For more information, see https://docs.pingcap.com/tidb/stable/ticdc-split-transaction-by-memory."
        },
        "outputFieldHeader": {
          "type": "boolean",
          "example": false,
          "description": "Indicates whether to include the CSV field header. The default value is false."
        }
      },
      "description": "The S3 data format configuration.",
      "required": [
        "protocol"
      ]
    },
    "v1beta2S3DataFormatProtocol": {
      "type": "string",
      "enum": [
        "PROTOCOL_UNSPECIFIED",
        "PROTOCOL_CSV",
        "PROTOCOL_CANAL_JSON"
      ],
      "default": "PROTOCOL_UNSPECIFIED",
      "description": "Protocol defines the supported output protocols for cloud storage sinks.\n\n - PROTOCOL_CSV: CSV format.\n - PROTOCOL_CANAL_JSON: Canal JSON format."
    },
    "v1beta2S3DownstreamConfig": {
      "type": "object",
      "properties": {
        "endpoint": {
          "description": "The S3 endpoint configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2S3DownstreamConfigEndpoint"
            }
          ]
        },
        "dataFormat": {
          "description": "The S3 data format configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2S3DataFormat"
            }
          ]
        },
        "storageFlushConfig": {
          "description": "The storage flush configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2StorageFlushConfig"
            }
          ]
        }
      },
      "description": "The S3 downstream configuration.",
      "required": [
        "endpoint",
        "dataFormat"
      ]
    },
    "v1beta2S3DownstreamConfigEndpoint": {
      "type": "object",
      "properties": {
        "s3Uri": {
          "type": "string",
          "example": "s3://my-bucket/cdc-data/",
          "description": "The S3 bucket URI. For example, `s3://bucket/prefix/`. The URI must end with a trailing slash.\n\nFor Alibaba Cloud OSS, use the S3-compatible URI format `s3://{bucket_name}/{prefix}/`. Do not use the raw OSS URI format."
        },
        "authType": {
          "example": "S3_AUTH_TYPE_AK_SK",
          "description": "The S3 authentication type.\n\n- `\"S3_AUTH_TYPE_UNSPECIFIED\"`: Default value.\n\n- `\"S3_AUTH_TYPE_AK_SK\"`: Access Key / Secret Key authentication.\n\n- `\"S3_AUTH_TYPE_ASSUME_ROLE\"`: IAM Assume Role authentication.",
          "allOf": [
            {
              "$ref": "#/definitions/EndpointS3AuthType"
            }
          ]
        },
        "accessKey": {
          "type": "string",
          "example": "AKIAIOSFODNN7EXAMPLE",
          "description": "The access key for S3 authentication. This field is required when authType is S3_AUTH_TYPE_AK_SK."
        },
        "secretKey": {
          "type": "string",
          "example": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
          "description": "The secret key for S3 authentication. This field is required when authType is S3_AUTH_TYPE_AK_SK. This field is input-only and not returned in responses."
        },
        "iamAssumedRoleArn": {
          "type": "string",
          "example": "arn:aws:iam::123456789012:role/CDCS3AccessRole",
          "description": "The IAM assumed role ARN for S3 authentication. This field is required when authType is S3_AUTH_TYPE_ASSUME_ROLE."
        },
        "customEndpoint": {
          "type": "string",
          "example": "https://s3.oss-{region_id}.aliyuncs.com",
          "description": "The custom S3-compatible endpoint. Required for Alibaba OSS."
        },
        "provider": {
          "example": "AWS",
          "description": "The object storage provider. If omitted or set to `\"PROVIDER_UNSPECIFIED\"`, AWS S3 behavior is used.\n\n- `\"AWS\"`: Amazon S3.\n\n- `\"ALIBABA_OSS\"`: Alibaba Cloud OSS through its S3-compatible endpoint.",
          "allOf": [
            {
              "$ref": "#/definitions/EndpointProvider"
            }
          ]
        }
      },
      "description": "The S3 endpoint configuration.",
      "required": [
        "s3Uri",
        "authType"
      ]
    },
    "v1beta2StartPosition": {
      "type": "object",
      "properties": {
        "mode": {
          "example": "FROM_NOW",
          "description": "The start position mode.\n\n- `\"MODE_UNSPECIFIED\"`: Default value.\n\n- `\"FROM_NOW\"`: Start from the current time.\n\n- `\"FROM_TSO\"`: Start from a specific TSO.\n\n- `\"FROM_UTC\"`: Start from a specific UTC timestamp.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2StartPositionMode"
            }
          ]
        },
        "startTso": {
          "type": "string",
          "format": "uint64",
          "example": "452348901234567890",
          "description": "The start TSO. This field is required when the mode is `FROM_TSO`."
        },
        "startTimestamp": {
          "type": "string",
          "example": "2026-01-01T00:00:00Z",
          "description": "The start UTC timestamp in RFC 3339 format. This field is required when the mode is `FROM_UTC`."
        }
      },
      "description": "The start position for the changefeed.",
      "required": [
        "mode"
      ]
    },
    "v1beta2StartPositionMode": {
      "type": "string",
      "enum": [
        "MODE_UNSPECIFIED",
        "FROM_NOW",
        "FROM_TSO",
        "FROM_UTC"
      ],
      "default": "MODE_UNSPECIFIED",
      "description": "Mode defines the start position mode.\n\n - MODE_UNSPECIFIED: Default value.\n - FROM_NOW: Start from the current time.\n - FROM_TSO: Start from a specific TSO.\n - FROM_UTC: Start from a specific UTC timestamp."
    },
    "v1beta2StorageFlushConfig": {
      "type": "object",
      "properties": {
        "interval": {
          "type": "string",
          "example": "1m",
          "description": "The flush interval as a duration string. The range is from 2s to 10m. The default value is 1m."
        },
        "fileSize": {
          "type": "string",
          "format": "uint64",
          "example": "67108864",
          "description": "The file size threshold in bytes. Data is flushed when this size is reached. The range is from 1048576 (1 MB) to 536870912 (512 MB). The default value is 67108864 (64 MB).",
          "maximum": 536870912,
          "minimum": 1048576
        }
      },
      "description": "The storage flush configuration."
    },
    "v1beta2TableConfig": {
      "type": "object",
      "properties": {
        "filterRules": {
          "type": "array",
          "example": [
            "mydb.orders",
            "mydb.user_*",
            "!mydb.secret_*"
          ],
          "items": {
            "type": "string"
          },
          "description": "The table filter rules. For example: `[\"mydb.orders\", \"mydb.user_*\", \"!mydb.secret_*\"]` Refer [TiCDC Table Filter](https://docs.pingcap.com/tidb/stable/ticdc-filter/#table-filter) for supported syntax."
        },
        "mode": {
          "example": "FORCE_SYNC",
          "description": "The mode for handling unsupported tables.\n\n- `\"MODE_UNSPECIFIED\"`: Default value. Must not be used.\n\n- `\"IGNORE_NOT_SUPPORT_TABLE\"`: Skip unsupported tables silently.\n\n- `\"FORCE_SYNC\"`: Force sync all tables (may fail on unsupported tables).",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TableConfigMode"
            }
          ]
        },
        "caseSensitive": {
          "type": "boolean",
          "description": "Indicates whether the filter rules are case-sensitive. The default value is false."
        },
        "eventFilters": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1beta2EventFilter"
          },
          "description": "The event filter rules for fine-grained control."
        },
        "bdrMode": {
          "type": "boolean",
          "description": "Indicates whether [bidirectional replication mode](https://docs.pingcap.com/tidb/stable/ticdc-bidirectional-replication/) is enabled."
        }
      },
      "description": "The table filtering and event filter configuration.",
      "required": [
        "mode"
      ]
    },
    "v1beta2TableConfigMode": {
      "type": "string",
      "enum": [
        "MODE_UNSPECIFIED",
        "IGNORE_NOT_SUPPORT_TABLE",
        "FORCE_SYNC"
      ],
      "default": "MODE_UNSPECIFIED",
      "description": "Mode defines how to handle tables that are not supported by the changefeed.\n\n - MODE_UNSPECIFIED: Default value.\n - IGNORE_NOT_SUPPORT_TABLE: Skip unsupported tables silently.\n - FORCE_SYNC: Force sync all tables (may fail on unsupported tables)."
    }
  }
}
