Creates or updates data assets - Gable Docs
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Creates or updates data assets
POST /v0/data-assets
cURL
curl --request POST \
--url https://demo-api.gable.ai/v0/data-assets \
--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"\
}\
]'
Example Payload in Different Languages
Python
import requests
url = "https://demo-api.gable.ai/v0/data-assets"
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 (Fetch)
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-assets', options)\
.then(res => res.json())\
.then(res => console.log(res))\
.catch(err => console.error(err));
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [\
CURLOPT_URL => "https://demo-api.gable.ai/v0/data-assets",\
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;
}
?>
Response Structure
Success (200)
[\
{\
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\
"versionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\
"dataAssetResourceName": "<string>",\
"newVersionCreated": true\
}\
]
Error Responses
{\
"message": "<string>",\
"id": 123,\
"title": "<string>"\
}
Authorization
- X-API-KEY: string (header, required)
Body Parameters
- dataAssetResourceName: string (required)
- domain: string (required)
- path: string (required)
- fields: object[] (required)
- description: string
- rawSchema: string
- prLink: string