Probe an unsaved REST API configuration

Send a validation request to the source using draft configuration to check connectivity and validation conditions.

POST https://api.moi.matrixorigin.cn/v5/connectors/rest-api/probe

Before you call this API

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

Request body

jq -n --slurpfile config "$REST_CONFIG_JSON" '{config:$config[0]}' > request.json
curl -X POST "https://api.moi.matrixorigin.cn/v5/connectors/rest-api/probe" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  --data-binary @request.json

The example builds the request from a raw configuration object in a file. It neither creates nor updates a connector but sends external HTTP requests. OAuth2 may first access a token endpoint. Probes allow GET or POST. POST may have source-side effects; confirm the selected verification endpoint first. Request bodies have a1 MiB read limit.

Fields

Type

Required

Description

config

object

Yes

Connector configuration JSON object containing rest_api, not a JSON string; read from a local file.

config.rest_api

object

Yes

Connection, authentication, and probe configuration; see common information.

config.rest_api.probe.enabled

boolean

Yes

Must be true for this operation. Probing is unavailable with the verification endpoint disabled.

Successful response

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "valid": true
  }
}

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.

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.

Last updated on