<span id="查询结构化来源读取能力"></span>

# Get structured-source read capabilities

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Query current read and CDC capabilities for a MySQL or Doris table.

```text
POST https://api.moi.matrixorigin.cn/v5/connectors/structured/v1/source/capabilities
```

<span id="调用前准备"></span>

## Before you call this API

Prepare a personal access token for the target workspace with source-read or import-run privileges. Install jq and set example variables. See [Common information](objects.md) for identity, environment, and result handoff.

<span id="请求体"></span>

## Request body

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl -X POST "https://api.moi.matrixorigin.cn/v5/connectors/structured/v1/source/capabilities" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  --data-binary "$(jq -n --arg v0 "$CONNECTOR_ID" --arg v1 "$CONNECTOR_ID" --arg v2 "$SOURCE_DATABASE" --arg v3 "$SOURCE_TABLE" '{"connector_id":$v0,"source":{"connector_id":$v1,"source_type":"SOURCE_TYPE_DORIS","database":$v2,"table":$v3}}')"
```

:::::
:::::{tab-item} Parameters

source_type must be SOURCE_TYPE_MYSQL or SOURCE_TYPE_DORIS and match the actual connector type. MySQL and Doris capabilities depend on deployment, Worker, and source configuration; type names alone do not establish availability. disabled_reasons contains only MYSQL_CDC_ and DORIS_CDC_ reasons. Doris read reasons are in doris_read_disabled_reasons separately. CDC availability does not imply every read method is available.

| Fields | Type | Required | Description |
| --- | --- | --- | --- |
| `connector_id` | string | Yes | Enabled connector ID supporting import in the current workspace. |
| `source` | object | Yes | Source object for the same connector. |
| `source.connector_id` | string | Yes | Must match the outer connector_id. |
| `source.source_type` | string | Yes | Uppercase API enum permitted by this operation, not the Worker's lowercase name. |
| `source.database` | string | Yes | Source database. |
| `source.table` | string | Yes | Source table. |
| `source.schema` | string | No | Provide when required by the source. |

:::::
::::::
:::::::

<span id="成功响应"></span>

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "capability_profile_hash": "profile-example",
    "mysql_cdc_available": false,
    "doris_cdc_available": true,
    "disabled_reasons": [],
    "doris_flight_sql_read_available": true,
    "doris_thrift_read_available": false,
    "doris_jdbc_read_available": true,
    "doris_read_mode": "flight_sql",
    "doris_read_disabled_reasons": null
  }
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | OK on success; also check HTTP and business codes. |
| `msg` | string | Response information. |
| `data` | object | Current source result. |
| `data.capability_profile_hash` | string | Current capability snapshot digest, not permanent authorization or deployment version. |
| `data.mysql_cdc_available` | boolean | Whether MySQL CDC is currently available. |
| `data.doris_cdc_available` | boolean | Whether Doris CDC is currently available. |
| `data.disabled_reasons` | string[] | Current CDC disabling reasons. |
| `data.doris_flight_sql_read_available` | boolean | Whether Flight SQL reading is currently available. |
| `data.doris_thrift_read_available` | boolean | Whether Thrift reading is currently available. |
| `data.doris_jdbc_read_available` | boolean | Whether JDBC reading is currently available. |
| `data.doris_read_mode` | string | Currently selected Doris read method. |
| `data.doris_read_disabled_reasons` | string[] or null | Source-reading disabling reasons, separate from CDC reasons. |

:::::
::::::
:::::::

<span id="错误响应"></span>

## Error response

Distinguish parameter, capability, authorization, and runtime-state failures using [Errors and environments](objects.md#errors-and-environments). Do not infer business success from HTTP 200 alone.
