Experiments
Get metric SQL model
Get a metric SQL model. Returns a single model by its ID for the organization, including its subject types, measures and properties.
get/api/v2/experiments/metric-sql-models/{metric_sql_model_id}
Request
- Base URLhttps://api.datadoghq.com
- Auth
- API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
- or OAuth 2Authorization code/oauth2/v1/authorizeToken URL/oauth2/v1/tokenScopesproduct_analytics_metrics_read
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
metric_sql_model_idstring uuid required
The UUID of the metric SQL model.
Example:550e8400-e29b-41d4-a716-446655440000
Query parameters
includestring[]
Optional fields to include. Repeat this parameter to request several fields. counts adds metric_count and experiment_count.
Response
OK
Example response
{
"data": {
"attributes": {
"created_at": "2024-01-01T12:00:00Z",
"event_count_measure_id": "550e8400-e29b-41d4-a716-446655440024",
"is_certified": false,
"measures": [
{
"column_name": "revenue",
"column_type": "FLOAT",
"id": "550e8400-e29b-41d4-a716-446655440021",
"name": "revenue"
}
],
"name": "Order facts",
"properties": [
{
"column_name": "item_type",
"column_type": "STRING",
"id": "550e8400-e29b-41d4-a716-446655440023",
"name": "item_type"
}
],
"sql": "SELECT user_id, order_id, item_type, revenue, created_at FROM analytics.orders",
"subject_types": [
{
"column_name": "user_id",
"subject_type_id": "550e8400-e29b-41d4-a716-446655440010",
"unique_subject_count_measure_id": "550e8400-e29b-41d4-a716-446655440022"
}
],
"timestamp_column": "created_at",
"updated_at": "2024-01-01T12:00:00Z"
},
"id": "550e8400-e29b-41d4-a716-446655440020",
"type": "metric-sql-models"
}
}Changes
Changes to this operation have not been checked yet.