Create a data asset - Gable Docs
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
POST
/ v0
/data-asset
Create a data asset
cURL
curl --request POST \
--url https://demo-api.gable.ai/v0/data-asset \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"dataAssetResourceName": "<string>",
"domain": "<string>",
"path": "<string>",
"fields": [
{
"name": "<string>",
"nativeDataType": "<string>",
"type": {},
"description": "<string>",
"order": 123,
"parentFieldId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changeSummary": "<string>",
"changeDescription": "<string>"
}
],
"description": "<string>",
"rawSchema": "<string>",
"prLink": "https://github.com/fakeorg/fakerepo/pull/123"
}
'
Python
import requests
url = "https://demo-api.gable.ai/v0/data-asset"
payload = {
"dataAssetResourceName": "<string>",
"domain": "<string>",
"path": "<string>",
"fields": [
{
"name": "<string>",
"nativeDataType": "<string>",
"type": {},
"description": "<string>",
"order": 123,
"parentFieldId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changeSummary": "<string>",
"changeDescription": "<string>"
}
],
"description": "<string>",
"rawSchema": "<string>",
"prLink": "https://github.com/fakeorg/fakerepo/pull/123"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
JavaScript
const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dataAssetResourceName: '<string>',
domain: '<string>',
path: '<string>',
fields: [
{
name: '<string>',
nativeDataType: '<string>',
type: {},
description: '<string>',
order: 123,
parentFieldId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
changeSummary: '<string>',
changeDescription: '<string>'
}
],
description: '<string>',
rawSchema: '<string>',
prLink: 'https://github.com/fakeorg/fakerepo/pull/123'
})
};
fetch('https://demo-api.gable.ai/v0/data-asset', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
PHP
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://demo-api.gable.ai/v0/data-asset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dataAssetResourceName' => '<string>',
'domain' => '<string>',
'path' => '<string>',
'fields' => [
[
'name' => '<string>',
'nativeDataType' => '<string>',
'type' => [],
'description' => '<string>',
'order' => 123,
'parentFieldId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'changeSummary' => '<string>',
'changeDescription' => '<string>'
]
],
'description' => '<string>',
'rawSchema' => '<string>',
'prLink' => 'https://github.com/fakeorg/fakerepo/pull/123'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://demo-api.gable.ai/v0/data-asset"
payload := strings.NewReader("{\n \"dataAssetResourceName\": \"<string>\",\n \"domain\": \"<string>\",\n \"path\": \"<string>\",\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"nativeDataType\": \"<string>\",\n \"type\": {},\n \"description\": \"<string>\",\n \"order\": 123,\n \"parentFieldId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"changeSummary\": \"<string>\",\n \"changeDescription\": \"<string>\"\n }\n ],\n \"description\": \"<string>\",\n \"rawSchema\": \"<string>\",\n \"prLink\": \"https://github.com/fakeorg/fakerepo/pull/123\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Responses
Success Response
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"versionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataAssetResourceName": "<string>",
"newVersionCreated": true
}
Error Response
{
"message": "<string>",
"id": 123,
"title": "<string>"
}
Authorizations
- X-API-KEY (string) - header required
Body
dataAssetResourceName(string) - required - The unique identifier of the data asset. It follows the pattern '{data_asset_type}://{data_asset_source}:{data_asset_name}'domain(string) - required - The domain or category to which the data asset belongs.path(string) - required - The name or path identifying the data asset.type(enum) - required - The type of the source data asset. fields(object[]) - required - The fields of the data asset.description(string) - A brief description of this particular version of the data asset.rawSchema(string) - The raw schema of the data asset.prLink(string) - Link to the PR that may have added or edited the data assets.