Public API v2 → Create External Schema Endpoint

About the /extraction/schema endpoint

The /extraction/schema endpoint creates a new external schema in the Spark Metastore for data extraction from verified business views. Only schemas defined in the CMC can be used in the data extraction endpoints.

Before using this endpoint, you must set the required configurations, such as enabling and configuring Advanced SQLi and setting the CMC configurations. For more information, refer to References → Data Extraction via Advanced SQLi and Public API.

This endpoint is the first of a series of endpoints that you use to extract data from verified business views into Parquet files that can be stored in different destinations, such as Google Cloud Storage, AWS S3, Azure, or local drive. After creating the external schema, you can use the POST /extraction/table endpoint to extract data to a new table or replace files in existing table. Afterward, you can use the PUT /extraction/table endpoint to append data to the path of an existing external table. For more information, refer to References → Data Extraction via Advanced SQLi and Public API.

Only the Super admin user (and users with the SuperRole when the Super User Mode is enabled) can use this endpoint.

For information about how to get started with Public API v2, refer to References → Public API v2.

Note

Use the HTTPS or HTTP scheme according to your installation. You must use the HTTPS scheme to successfully run the API endpoints on Cloud installations.

Request URL

https://<cluster_URL>/incorta/api/v2/{tenant}/extraction/schema

Examples:

  • https://mycluster.incorta.com/incorta/api/v2/default/extraction/schema
  • https://10.1.2.3:8080/incorta/api/v2/default/extraction/schema

Request URL Parameters

ParameterDescriptionTypeRequired
tenantThe tenant name (case-sensitive)StringRequired

HTTP method

POST

Request headers

{
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {access_token}"
}

You must use a valid access token for the Super admin user (or a user with the SuperRole if the Super User Mode is enabled). For information about creating an access token, refer to Public API v2 → Create an API access token.

Request body

{
"name": "string"
}

Request body parameters

ParameterTypeDescriptionRequired
nameStringThe name of the external schema you want to create.
It must be one of the schemas specified in the CMC > Tenant Configurations > Incorta Labs > External Schemas for Data Extraction.
Required

Example:

{
"name": "externalSchema1"
}

Endpoint response

The following table shows the HTTP response status codes for this endpoint.

CodeDescriptionPayload Response
200OK
The endpoint successfully ran and created the new external schema.
400Bad Request
You provided invalid values.
{"errorMessages": [{"message": "string"}]}
Example:
{"errorMessages": [{"message": "INC_01210000: name may not be null"}, {"message": "INC_01210000: name may not be null"}]}
401Unauthenticated
The endpoint couldn’t create the external schema due to authentication errors, such as an invalid or expired access token.
{"message": "string"}
Example:
{"message": "INC_09030108: Invalid authentication header. Invalid Token [abcd1234]"}
404Not Found
The tenant doesn't exist or is disabled.
{"message": "string"}
Example:
{"message": "Invalid [DEFAULT] tenant in resource path"}
500Internal Server Error
The endpoint couldn’t run successfully due to a server error.
{"message": "string"}
Example:
{"message": "The target schema name externalSchema not allowed for extraction"}