from metadata.sdk import configurefrom metadata.sdk.entities import Chartsfrom metadata.generated.schema.api.data.createChart import CreateChartRequestconfigure( host="https://your-company.getcollate.io/api", jwt_token="your-jwt-token")request = CreateChartRequest( 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")chart = Charts.create(request)print(f"Created: {chart.fullyQualifiedName}")
Copy
Ask AI
{ "id": "2dde4b53-a577-424b-bbaa-18ac32eca8a9", "name": "114", "displayName": "# of Games That Hit 100k in Sales By Release Year", "fullyQualifiedName": "sample_superset.114", "description": "Bar chart showing games that hit 100k in sales by release year", "chartType": "Other", "version": 0.1, "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": [], "followers": [], "votes": { "upVotes": 0, "downVotes": 0 }, "domains": []}
from metadata.sdk import configurefrom metadata.sdk.entities import Chartsfrom metadata.generated.schema.api.data.createChart import CreateChartRequestconfigure( host="https://your-company.getcollate.io/api", jwt_token="your-jwt-token")request = CreateChartRequest( 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")chart = Charts.create(request)print(f"Created: {chart.fullyQualifiedName}")
Copy
Ask AI
{ "id": "2dde4b53-a577-424b-bbaa-18ac32eca8a9", "name": "114", "displayName": "# of Games That Hit 100k in Sales By Release Year", "fullyQualifiedName": "sample_superset.114", "description": "Bar chart showing games that hit 100k in sales by release year", "chartType": "Other", "version": 0.1, "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": [], "followers": [], "votes": { "upVotes": 0, "downVotes": 0 }, "domains": []}
Custom property values defined by your organization’s metadata schema.
POST /v1/charts
Copy
Ask AI
from metadata.sdk import configurefrom metadata.sdk.entities import Chartsfrom metadata.generated.schema.api.data.createChart import CreateChartRequestconfigure( host="https://your-company.getcollate.io/api", jwt_token="your-jwt-token")request = CreateChartRequest( 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")chart = Charts.create(request)print(f"Created: {chart.fullyQualifiedName}")
Copy
Ask AI
{ "id": "2dde4b53-a577-424b-bbaa-18ac32eca8a9", "name": "114", "displayName": "# of Games That Hit 100k in Sales By Release Year", "fullyQualifiedName": "sample_superset.114", "description": "Bar chart showing games that hit 100k in sales by release year", "chartType": "Other", "version": 0.1, "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": [], "followers": [], "votes": { "upVotes": 0, "downVotes": 0 }, "domains": []}
Use PUT /v1/charts instead of POST to perform an upsert. If a chart with the same fullyQualifiedName already exists, it will be updated; otherwise, a new chart is created. The request body is the same as POST.
Copy
Ask AI
curl -X PUT "{base_url}/api/v1/charts" \ -H "Authorization: Bearer {access_token}" \ -H "Content-Type: application/json" \ -d '{ ... same body as POST ... }'
PUT will not return a 409 conflict error if the entity already exists — it will update the existing entity instead.