PUT /v1/charts
curl -X PUT "{base_url}/api/v1/charts" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "114",
"displayName": "# of Games That Hit 100k in Sales By Release Year",
"service": "sample_superset",
"description": "Bar chart showing games that hit 100k in sales by release year",
"chartType": "Other",
"sourceUrl": "http://localhost:808/explore/?slice_id=114"
}'
from metadata.sdk import configure
from metadata.sdk.entities import Charts
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Retrieve, modify, and update
chart = Charts.retrieve("2dde4b53-a577-424b-bbaa-18ac32eca8a9")
chart.description = "Updated: Bar chart showing top-selling games by release year"
chart.chartType = "Bar"
updated = Charts.update(chart)
print(f"Updated to version {updated.version.root}")
import org.openmetadata.schema.entity.data.Chart;
// client is an initialized OpenMetadataClient.
// Retrieve, modify, and update
Chart chart = client.charts().get("2dde4b53-a577-424b-bbaa-18ac32eca8a9");
chart.setDescription("Updated: Bar chart showing top-selling games by release year");
Chart updated = client.charts().update("2dde4b53-a577-424b-bbaa-18ac32eca8a9", chart);
# Update by ID
curl -X PATCH "{base_url}/api/v1/charts/2dde4b53-a577-424b-bbaa-18ac32eca8a9" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Bar chart showing top-selling games by release year"}
]'
# Update by name
curl -X PATCH "{base_url}/api/v1/charts/name/sample_superset.114" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Bar chart showing top-selling games by release year"}
]'
{
"id": "2dde4b53-a577-424b-bbaa-18ac32eca8a9",
"name": "114",
"displayName": "# of Games That Hit 100k in Sales By Release Year",
"fullyQualifiedName": "sample_superset.114",
"description": "Updated: Bar chart showing top-selling games by release year",
"chartType": "Bar",
"version": 0.2,
"updatedAt": 1769982666218,
"updatedBy": "admin",
"sourceUrl": "http://localhost:808/explore/?slice_id=114",
"service": {
"id": "b1e6a71d-7f47-4e5f-8ce0-e6e8a88ec97a",
"type": "dashboardService",
"name": "sample_superset",
"fullyQualifiedName": "sample_superset",
"deleted": false
},
"serviceType": "Superset",
"href": "http://localhost:8585/api/v1/charts/2dde4b53-a577-424b-bbaa-18ac32eca8a9",
"deleted": false,
"owners": [],
"tags": [],
"domains": []
}
Update a Chart
Create or update a chart with a full request body
PUT
/
v1
/
charts
PUT /v1/charts
curl -X PUT "{base_url}/api/v1/charts" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "114",
"displayName": "# of Games That Hit 100k in Sales By Release Year",
"service": "sample_superset",
"description": "Bar chart showing games that hit 100k in sales by release year",
"chartType": "Other",
"sourceUrl": "http://localhost:808/explore/?slice_id=114"
}'
from metadata.sdk import configure
from metadata.sdk.entities import Charts
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Retrieve, modify, and update
chart = Charts.retrieve("2dde4b53-a577-424b-bbaa-18ac32eca8a9")
chart.description = "Updated: Bar chart showing top-selling games by release year"
chart.chartType = "Bar"
updated = Charts.update(chart)
print(f"Updated to version {updated.version.root}")
import org.openmetadata.schema.entity.data.Chart;
// client is an initialized OpenMetadataClient.
// Retrieve, modify, and update
Chart chart = client.charts().get("2dde4b53-a577-424b-bbaa-18ac32eca8a9");
chart.setDescription("Updated: Bar chart showing top-selling games by release year");
Chart updated = client.charts().update("2dde4b53-a577-424b-bbaa-18ac32eca8a9", chart);
# Update by ID
curl -X PATCH "{base_url}/api/v1/charts/2dde4b53-a577-424b-bbaa-18ac32eca8a9" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Bar chart showing top-selling games by release year"}
]'
# Update by name
curl -X PATCH "{base_url}/api/v1/charts/name/sample_superset.114" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Bar chart showing top-selling games by release year"}
]'
{
"id": "2dde4b53-a577-424b-bbaa-18ac32eca8a9",
"name": "114",
"displayName": "# of Games That Hit 100k in Sales By Release Year",
"fullyQualifiedName": "sample_superset.114",
"description": "Updated: Bar chart showing top-selling games by release year",
"chartType": "Bar",
"version": 0.2,
"updatedAt": 1769982666218,
"updatedBy": "admin",
"sourceUrl": "http://localhost:808/explore/?slice_id=114",
"service": {
"id": "b1e6a71d-7f47-4e5f-8ce0-e6e8a88ec97a",
"type": "dashboardService",
"name": "sample_superset",
"fullyQualifiedName": "sample_superset",
"deleted": false
},
"serviceType": "Superset",
"href": "http://localhost:8585/api/v1/charts/2dde4b53-a577-424b-bbaa-18ac32eca8a9",
"deleted": false,
"owners": [],
"tags": [],
"domains": []
}
Update a Chart
Create a chart or update it if it already exists, usingPUT /v1/charts with the full request body. Send the complete definition, not just the fields you want to change. To change only some fields, use PATCH with a JSON Patch array and the application/json-patch+json content type, as shown in the PATCH examples below.
Body Parameters
PUT /v1/charts
curl -X PUT "{base_url}/api/v1/charts" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "114",
"displayName": "# of Games That Hit 100k in Sales By Release Year",
"service": "sample_superset",
"description": "Bar chart showing games that hit 100k in sales by release year",
"chartType": "Other",
"sourceUrl": "http://localhost:808/explore/?slice_id=114"
}'
from metadata.sdk import configure
from metadata.sdk.entities import Charts
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Retrieve, modify, and update
chart = Charts.retrieve("2dde4b53-a577-424b-bbaa-18ac32eca8a9")
chart.description = "Updated: Bar chart showing top-selling games by release year"
chart.chartType = "Bar"
updated = Charts.update(chart)
print(f"Updated to version {updated.version.root}")
import org.openmetadata.schema.entity.data.Chart;
// client is an initialized OpenMetadataClient.
// Retrieve, modify, and update
Chart chart = client.charts().get("2dde4b53-a577-424b-bbaa-18ac32eca8a9");
chart.setDescription("Updated: Bar chart showing top-selling games by release year");
Chart updated = client.charts().update("2dde4b53-a577-424b-bbaa-18ac32eca8a9", chart);
# Update by ID
curl -X PATCH "{base_url}/api/v1/charts/2dde4b53-a577-424b-bbaa-18ac32eca8a9" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Bar chart showing top-selling games by release year"}
]'
# Update by name
curl -X PATCH "{base_url}/api/v1/charts/name/sample_superset.114" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Bar chart showing top-selling games by release year"}
]'
{
"id": "2dde4b53-a577-424b-bbaa-18ac32eca8a9",
"name": "114",
"displayName": "# of Games That Hit 100k in Sales By Release Year",
"fullyQualifiedName": "sample_superset.114",
"description": "Updated: Bar chart showing top-selling games by release year",
"chartType": "Bar",
"version": 0.2,
"updatedAt": 1769982666218,
"updatedBy": "admin",
"sourceUrl": "http://localhost:808/explore/?slice_id=114",
"service": {
"id": "b1e6a71d-7f47-4e5f-8ce0-e6e8a88ec97a",
"type": "dashboardService",
"name": "sample_superset",
"fullyQualifiedName": "sample_superset",
"deleted": false
},
"serviceType": "Superset",
"href": "http://localhost:8585/api/v1/charts/2dde4b53-a577-424b-bbaa-18ac32eca8a9",
"deleted": false,
"owners": [],
"tags": [],
"domains": []
}
Returns
Returns the updated chart object with the new version number.Response
Error Handling
| Code | Error Type | Description |
|---|---|---|
400 | BAD_REQUEST | Invalid or malformed request body |
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to update this chart |
409 | CONFLICT | Concurrent modification detected |
Was this page helpful?