Python
import os
from meibel import MeibelClient
from meibel.models import UpdateDataElementRequest
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
updated_element = client.datasources.data_elements.update(
datasource_id="ds_9f3c2a1b7e",
data_element_id="elem_4a8b1c2d3e",
body=UpdateDataElementRequest(
name="Q4 Sales Report (Final)",
description="Final version of the Q4 sales report, reviewed by finance",
metadata={"reviewed": True, "reviewer": "jane.doe@example.com"},
),
)
print(f"{updated_element.id}: {updated_element.name}")
print(f"Updated at: {updated_element.updated_at}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const dataElement = await client.datasources.dataElements.update(
"ds_9f8a7b6c5d4e",
"elem_3c2b1a0f9e8d",
{
name: "Q4 Sales Report",
description: "Quarterly sales figures for North America region",
metadata: {
region: "north-america",
quarter: "Q4-2024",
},
}
);
console.log(`${dataElement.name}: ${dataElement.description}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
element, err := client.Datasources.DataElements.Update(
context.Background(),
"ds_9f3c8b2a1e4d",
"elem_7a2b1c9d4e3f",
v2.UpdateDataElementRequest{
Name: v2.String("Q3 Sales Report"),
Description: v2.String("Quarterly sales figures grouped by region"),
Metadata: map[string]any{
"region": "north-america",
"fiscal_year": 2024,
},
},
)
if err != nil {
panic(err)
}
fmt.Printf("Updated data element %s: %s\n", element.ID, element.Name)
}curl --request PUT \
--url https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/{data_element_id} \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"metadata": {}
}
'const options = {
method: 'PUT',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>', metadata: {}})
};
fetch('https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/{data_element_id}', 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://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/{data_element_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/{data_element_id}")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/{data_element_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"datasource_id": "<string>",
"name": "<string>",
"description": "<string>",
"media_type": "<string>",
"metadata": {},
"created_at": "<string>",
"updated_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Data elements
Update Data Element
PUT
/
datasources
/
{datasource_id}
/
data-elements
/
{data_element_id}
Python
import os
from meibel import MeibelClient
from meibel.models import UpdateDataElementRequest
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
updated_element = client.datasources.data_elements.update(
datasource_id="ds_9f3c2a1b7e",
data_element_id="elem_4a8b1c2d3e",
body=UpdateDataElementRequest(
name="Q4 Sales Report (Final)",
description="Final version of the Q4 sales report, reviewed by finance",
metadata={"reviewed": True, "reviewer": "jane.doe@example.com"},
),
)
print(f"{updated_element.id}: {updated_element.name}")
print(f"Updated at: {updated_element.updated_at}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const dataElement = await client.datasources.dataElements.update(
"ds_9f8a7b6c5d4e",
"elem_3c2b1a0f9e8d",
{
name: "Q4 Sales Report",
description: "Quarterly sales figures for North America region",
metadata: {
region: "north-america",
quarter: "Q4-2024",
},
}
);
console.log(`${dataElement.name}: ${dataElement.description}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
element, err := client.Datasources.DataElements.Update(
context.Background(),
"ds_9f3c8b2a1e4d",
"elem_7a2b1c9d4e3f",
v2.UpdateDataElementRequest{
Name: v2.String("Q3 Sales Report"),
Description: v2.String("Quarterly sales figures grouped by region"),
Metadata: map[string]any{
"region": "north-america",
"fiscal_year": 2024,
},
},
)
if err != nil {
panic(err)
}
fmt.Printf("Updated data element %s: %s\n", element.ID, element.Name)
}curl --request PUT \
--url https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/{data_element_id} \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"metadata": {}
}
'const options = {
method: 'PUT',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>', metadata: {}})
};
fetch('https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/{data_element_id}', 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://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/{data_element_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/{data_element_id}")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/{data_element_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"datasource_id": "<string>",
"name": "<string>",
"description": "<string>",
"media_type": "<string>",
"metadata": {},
"created_at": "<string>",
"updated_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
Response
Successful Response
A single data element on a datasource.
Unique data element ID
ID of the datasource this element belongs to
Data element name
Human-authored description
MIME type of the underlying content
Arbitrary metadata key-value pairs
ISO 8601 creation timestamp
ISO 8601 last-update timestamp
Was this page helpful?
⌘I