<span id="探测已保存的-rest-api-连接器"></span>

# Probe a saved REST API connector

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

Send a source verification request using the saved connector configuration and credentials.

```text
POST https://api.moi.matrixorigin.cn/v5/connectors/{id}/rest-api/probe
```

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

## Before you call this API

Prepare a personal access token for the target workspace and the connector operation permissions. See [common information](objects.md) for draft files, source endpoints, and environment boundaries.

<span id="请求示例"></span>

## Request example

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

```bash
curl -X POST "https://api.moi.matrixorigin.cn/v5/connectors/$CONNECTOR_ID/rest-api/probe" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

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

No request body is needed, and a body cannot temporarily override saved configuration. The connector must be active, a REST API source with import purpose, and have an enabled verification endpoint. Success proves only this verification passed, not preview, task creation, or data import. Source HTTP and token endpoints may still be accessed.

| Fields | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Required in path | Enabled REST API connector ID supporting import in the current workspace. |

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

<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": {
    "valid": true
  }
}
```

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

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | OK on success. |
| `msg` | string | Response information. |
| `data` | object | Result of this action. |
| `data.valid` | boolean | true on success, meaning this source probe and configured success conditions passed. |

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

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

## Error response

Handle configuration errors separately from source-execution failures. MOI may wrap a source error as HTTP 502 `ErrConnectorRESTRead`. The source HTTP status in an error message is not this request's status. See [Errors and environments](objects.md#errors-and-environments).
