Obtain a GoodData Cloud API token from your profile settings and set it as a Bearer token in the Authorization header for all API calls
POST to /api/v1/entities/workspaces/{workspace-id}/metrics with a JSON body containing id, type: metric, attributes with title, description, and content fields; the content field includes a format string and a maql expression
Write the MAQL expression using facts, attributes, and previously defined metrics from your logical data model (e.g., SELECT SUM(revenue) WHERE region = 'US')
After creation, retrieve the metric with GET /api/v1/entities/workspaces/{workspace-id}/metrics/{metric-id} to confirm the definition was stored correctly
Reference the metric in Analytical Designer or embed it in a dashboard widget by its id; metrics created via API appear alongside metrics created in the Metric Editor UI
Known gotchas
MAQL expressions must reference logical data model object identifiers (not physical column names); using a physical column name directly will produce a MAQL parse error because MAQL operates on the LDM abstraction layer
Workspace-level metrics are scoped to a single workspace; to share a metric across workspaces, you must recreate it in each workspace or use parent-workspace inheritance if your GoodData deployment supports hierarchical workspaces
Updating an existing metric requires a PUT or PATCH request to the metric's specific endpoint; a POST to the collection endpoint with an existing id will return a conflict error rather than overwriting silently
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp