Query the connector table structure

Reads the field structure and mapping reference of the selected source object.

HTTP
POST $CLOUDSIGMA_API_BASE/connectors/structured/v1/source/schema

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a personal access token and target workspace ID that can access the target workspace. Obtain the identifier of the same source object in the following order:

  1. Query the connector that supports database browsing.

  2. Query source database list.

  3. When the source supports Schema, Query the Schema list of the source database.

  4. Query source table and collection list.

Request body

Replace the source object IDs in $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, and examples with actual values.

relational table

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/connectors/structured/v1/source/schema" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d @- <<EOF
{
  "connector_id": "$CONNECTOR_ID",
  "source": {
    "connector_id": "$CONNECTOR_ID",
    "source_type": "$SOURCE_TYPE",
    "database": "$DATABASE",
    "schema": "$SCHEMA",
    "table": "$TABLE"
  }
}
EOF

MongoDB collection

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/connectors/structured/v1/source/schema" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d @- <<EOF
{
  "connector_id": "$CONNECTOR_ID",
  "source": {
    "connector_id": "$CONNECTOR_ID",
    "source_type": "SOURCE_TYPE_MONGODB",
    "database": "$DATABASE",
    "collection": "$COLLECTION"
  },
  "mongo_sample_limit": 100
}
EOF

schema is required for PostgreSQL, SQLServer and Oracle. schema, collection must be empty for MySQL, Hive and Doris. MongoDB’s schema, table must be empty. Although Kafka has description and sampling capability records, it is currently unable to fully query the field structure.

MongoDB must fill in the sampling upper limit of 1–100. The returned fields are inferred based on the sample of find().limit(n) and may not contain all fields in the collection.

relational table

Parameter

Type

Required

Description

connector_id

string

Yes

Connector ID.

source

object

Yes

source object. MongoDB source object.

source.connector_id

string

Yes

Same as the top-level connector ID.

source.source_type

string

Yes

Source type. Source type. The values ​​are SOURCE_TYPE_HIVE, SOURCE_TYPE_MYSQL, SOURCE_TYPE_SQLSERVER, SOURCE_TYPE_ORACLE, SOURCE_TYPE_POSTGRESQL, SOURCE_TYPE_MONGODB, SOURCE_TYPE_KAFKA, SOURCE_TYPE_DORIS.

source.database

string

Yes

Database name.

source.schema

string

Conditional

PostgreSQL, SQLServer, Oracle required. MySQL, Hive, Doris, MongoDB do not allow non-null values.

source.table

string

Yes

Table name.

source.table

string

No

Table name.

source.collection

string

Conditional

Required collection name for MongoDB branches. Relational branches do not accept non-null values.

mongo_sample_limit

integer

Conditional

The MongoDB branch must be provided in the range 1–100.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "schema_snapshot": {
      "source": {},
      "schema_kind": "columns"
    },
    "mapping_draft": [],
    "target_type_catalog": [],
    "field_compatibilities": [],
    "source_schema_hash": "schema-hash",
    "source_object_hash": "object-hash",
    "connector_config_hash": "connector-hash",
    "mapping_hash": "mapping-hash",
    "flatten_hash": "flatten-hash",
    "endpoint_results": []
  }
}

Field

Type

Description

code

string

success code.

msg

string

Response information.

data

object

The data returned by this operation.

data.schema_snapshot

object

Source field structure.

data.schema_snapshot.source

object

Structured source positioning.

data.schema_snapshot.source.connector_id

string

Association ID.

data.schema_snapshot.source.source_type

string or integer

Source type.

data.schema_snapshot.source.database

string

Database name.

data.schema_snapshot.source.schema

string

Database schema name.

data.schema_snapshot.source.table

string

Table name.

data.schema_snapshot.source.collection

string

MongoDB collection name.

data.schema_snapshot.columns

array of object

Relational columns.

data.schema_snapshot.columns[].name

string

The name of the current object.

data.schema_snapshot.columns[].source_type

string

Source type.

data.schema_snapshot.columns[].nullable

boolean

Whether to allow null values.

data.schema_snapshot.columns[].is_primary_key

boolean

Whether it is the primary key.

data.schema_snapshot.columns[].is_auto_incr

boolean

Whether to increment automatically.

data.schema_snapshot.columns[].comment

string

Field description.

data.schema_snapshot.columns[].ordinal

integer

serial number.

data.schema_snapshot.columns[].unsigned

boolean

Whether it is an unsigned number.

data.schema_snapshot.columns[].source_identifier

string

Source identification.

data.schema_snapshot.mongo_fields

array of object

MongoDB inferred fields.

data.schema_snapshot.mongo_fields[].path

object

Field path.

data.schema_snapshot.mongo_fields[].path.segments

array of object

Field path segments.

data.schema_snapshot.mongo_fields[].path.segments[].name

string

The name of the current object.

data.schema_snapshot.mongo_fields[].path.segments[].segment_type

string

Path segment type.

data.schema_snapshot.mongo_fields[].bson_types

array of string

The observed BSON type.

data.schema_snapshot.mongo_fields[].recommended_target_type

string

Recommended target type.

data.schema_snapshot.mongo_fields[].nullable

boolean

Whether to allow null values.

data.schema_snapshot.mongo_fields[].observed_count

integer

The number of samples in which the field was observed.

data.schema_snapshot.mongo_fields[].missing_count

integer

Number of samples with missing fields.

data.schema_snapshot.mongo_fields[].null_count

integer

The number of samples where the field is null.

data.schema_snapshot.mongo_fields[].example_extended_json

string

Extended JSON sample.

data.schema_snapshot.schema_kind

string

Snapshot type. The values are columns, mongodb_inferred_fields

data.mapping_draft

array of object

Candidate mapping.

data.mapping_draft[].source

object

Structured source positioning.

data.mapping_draft[].source.kind

string

Resource type.

data.mapping_draft[].source.column

string

Column positioning.

data.mapping_draft[].source.mongo_path

object

MongoDB field path.

data.mapping_draft[].source.mongo_path.segments

array of object

Field path segments.

data.mapping_draft[].source.mongo_path.segments[].name

string

The name of the current object.

data.mapping_draft[].source.mongo_path.segments[].segment_type

string

Path segment type.

data.mapping_draft[].source.source_type

string

Source type.

data.mapping_draft[].source.source_ordinal

integer

Source serial number.

data.mapping_draft[].source.extra

object

Extended string property objects allow extended keys.

data.mapping_draft[].source.has_source_ordinal

boolean

Whether to include the source serial number.

data.mapping_draft[].target_column

string

Target column name.

data.mapping_draft[].target_type

string

Target type.

data.mapping_draft[].nullable

boolean

Whether to allow null values.

data.mapping_draft[].primary_key

boolean

Whether it is the primary key.

data.mapping_draft[].allow_duplicate_source

boolean

Whether duplicate sources are allowed.

data.mapping_draft[].default_value

string

Default value.

data.mapping_draft[].description

string

Description of the current object.

data.mapping_draft[].has_default_value

boolean

Whether to provide a default value.

data.target_type_catalog

array of object

Target type directory.

data.target_type_catalog[].target_type

string

Target type.

data.target_type_catalog[].category

string

classification.

data.target_type_catalog[].parameters

array of object

model parameters.

data.target_type_catalog[].parameters[].name

string

The name of the current object.

data.target_type_catalog[].parameters[].min_value

integer

minimum value.

data.target_type_catalog[].parameters[].max_value

integer

maximum value.

data.target_type_catalog[].parameters[].default_value

integer

Default value.

data.target_type_catalog[].parameters[].max_value_from_parameter

string

The source parameter of the maximum value.

data.field_compatibilities

array of object

Field compatibility reference.

data.field_compatibilities[].source

object

Structured source positioning.

data.field_compatibilities[].source.kind

string

Resource type.

data.field_compatibilities[].source.column

string

Column positioning.

data.field_compatibilities[].source.mongo_path

object

MongoDB field path.

data.field_compatibilities[].source.mongo_path.segments

array of object

Field path segments.

data.field_compatibilities[].source.mongo_path.segments[].name

string

The name of the current object.

data.field_compatibilities[].source.mongo_path.segments[].segment_type

string

Path segment type.

data.field_compatibilities[].source.source_type

string

Source type.

data.field_compatibilities[].source.source_ordinal

integer

Source serial number.

data.field_compatibilities[].source.extra

object

Extended string property objects allow extended keys.

data.field_compatibilities[].source.has_source_ordinal

boolean

Whether to include the source serial number.

data.field_compatibilities[].recommended_target_type

string

Recommended target type.

data.field_compatibilities[].target_compatibilities

array of object

Optional target compatibility scheme.

data.field_compatibilities[].target_compatibilities[].target_type

string

Target type.

data.field_compatibilities[].target_compatibilities[].status

string

status.

data.field_compatibilities[].target_compatibilities[].reason_code

string

Reason code.

data.field_compatibilities[].selected_compatibility

object

Compatibility plan selected.

data.field_compatibilities[].selected_compatibility.target_type

string

Target type.

data.field_compatibilities[].selected_compatibility.status

string

status.

data.field_compatibilities[].selected_compatibility.reason_code

string

Reason code.

data.source_schema_hash

string

Field structure identifier.

data.source_object_hash

string

Source object identifier.

data.connector_config_hash

string

Connector configuration identifier.

data.mapping_hash

string

Mapping reference identifier.

data.flatten_hash

string

Flat reference mark.

data.endpoint_results

array

Reserve result sets.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "invalid parameter",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

error message.

data

null

The error response is null.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

200

STRUCTURED_LOAD_FEATURE_DISABLED, STRUCTURED_LOAD_MONGODB_DISABLED

Business processing did not succeed; an HTTP 2xx status does not guarantee business success.

Inspect the business code and feature flags instead of relying on the HTTP status alone.

400

ErrParamInvalid, ErrWorkspaceRequired, SOURCE_READ_FAILED

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

500

ErrServer

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

Last updated on