List metric SQL models
List metric SQL models. Returns a paginated list of the SQL models that metrics are defined on for the organization.
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.
Query parameters
Optional fields to include. Repeat this parameter to request several fields. counts adds metric_count and experiment_count, which cost an extra aggregate query.
Maximum number of results to return. Defaults to 25 when omitted, and is capped at 50 (larger values are clamped to 50). The response includes meta.page (with total) and pagination links.
Maximum number of results to return. Defaults to 25 when omitted, and is capped at 50 (larger values are clamped to 50). The response includes meta.page (with total) and pagination links.
Number of results to skip for pagination. Defaults to 0 when omitted.
Sort field: name, created_at, updated_at, metric_count, or experiment_count. A single field only; a comma-separated list is rejected. Prefix with - for descending (for example, -created_at). Defaults to created_at descending.
Sort field: name, created_at, updated_at, metric_count, or experiment_count. A single field only; a comma-separated list is rejected. Prefix with - for descending (for example, -created_at). Defaults to created_at descending.
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.