Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

Get Embeddable URL

Get an embeddable customer dashboard
v1.dashboards.get_embeddable_url(DashboardGetEmbeddableURLParams**kwargs) -> dataDataDashboardGetEmbeddableURLResponse
post/v1/dashboards/getEmbeddableUrl

Retrieve an embeddable dashboard url for a customer. The dashboard can be embedded using an iframe in a website. This will show information such as usage data and customer invoices.

Parameters
customer_idstr
formatuuid
dashboardliteral
Literal["invoices", "usage", "credits", "commits_and_credits"]

The type of dashboard to retrieve.

Hide ParametersShow Parameters
"invoices"
"usage"
"credits"
"commits_and_credits"
bm_group_key_overridesiterable
optional
group_key_namestrdisplay_namestrvalue_display_namesDict[str, object]Iterable[BmGroupKeyOverride]

Optional list of billable metric group key overrides

Hide ParametersShow Parameters
group_key_namestr

The name of the billable metric group key.

display_namestr
optional

The display name for the billable metric group key

value_display_namesDict[str, object]
optional
Dict[str, object]

<key, value> pairs of the billable metric group key values and their display names. e.g. {"a": "Asia", "b": "Euro"}

color_overridesiterable
optional
nameliteralvaluestrIterable[ColorOverride]

Optional list of colors to override

Hide ParametersShow Parameters
nameliteral
optional
Literal["Gray_dark", "Gray_medium", "Gray_light", 18 more]

The color to override

Hide ParametersShow Parameters
"Gray_dark"
"Gray_medium"
"Gray_light"
"Gray_extralight"
"White"
"Primary_medium"
"Primary_light"
"UsageLine_0"
"UsageLine_1"
"UsageLine_2"
"UsageLine_3"
"UsageLine_4"
"UsageLine_5"
"UsageLine_6"
"UsageLine_7"
"UsageLine_8"
"UsageLine_9"
"Primary_green"
"Primary_red"
"Progress_bar"
"Progress_bar_background"
valuestr
optional

Hex value representation of the color

dashboard_optionsiterable
optional
keystrvaluestrIterable[DashboardOption]

Optional dashboard specific options

Hide ParametersShow Parameters
keystr

The option key name

valuestr

The option value

Returns
DashboardGetEmbeddableURLResponseclass
Hide ParametersShow Parameters
dataurlstrData
Hide ParametersShow Parameters
urlstr
optional
from metronome import Metronome

client = Metronome(
    bearer_token="My Bearer Token",
)
response = client.v1.dashboards.get_embeddable_url(
    customer_id="4db51251-61de-4bfe-b9ce-495e244f3491",
    dashboard="invoices",
    bm_group_key_overrides=[{
        "group_key_name": "tenant_id",
        "display_name": "Org ID",
        "value_display_names": {
            "48ecb18f358f": "Cluster EU",
            "e358f3ce242d": "Cluster APAC",
        },
    }],
    color_overrides=[{
        "name": "Gray_dark",
        "value": "#ff0000",
    }],
    dashboard_options=[{
        "key": "show_zero_usage_line_items",
        "value": "false",
    }, {
        "key": "hide_voided_invoices",
        "value": "true",
    }],
)
print(response.data)
200 Example
{
  "data": {
    "url": "url"
  }
}