Updated on 2025-11-25 GMT+08:00

Creating a Source Data Schema

Function

This API is used to create a schema for JSON source data.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/schema

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For how to obtain it, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 1 to 64 characters. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. You can obtain it by calling the IAM API for obtaining a user token. The user token is the value of X-Subject-Token in the response header. For details, see Token-based Authentication.

Constraints

N/A

Range

The value can contain 1 to 32,768 characters.

Default Value

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

source_data_sample

Yes

String

Definition

Source data sample, which is used to generate a schema from JSON source data. You can import a source data sample or create source data.

Constraints

The source data must be in JSON format.

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Normal response

None

Example Requests

Create a source data schema.

POST https://{Endpoint}/v1/{project_id}/schema

{
  "source_data_sample" : ""
}

Example Responses

Status code: 200

Normal response

{
  "schema" : ""
}

Status Codes

Status Code

Description

200

Normal response

Error Codes

See Error Codes.