Experiments
Create exposure SQL model
Create an exposure SQL model. Requires at least one subject type. The warehouse connection is resolved from the organization, which has exactly one.
post/api/v2/experiments/exposure-sql-models
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_warehouse_model_write
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"data": {
"attributes": {
"date_partition_column": null,
"experiment_column": "experiment_id",
"name": "Exposure events",
"properties": [
{
"column_name": "country",
"column_type": "STRING",
"description": null,
"name": "country"
}
],
"sql": "SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures",
"subject_types": [
{
"column_name": "user_id",
"subject_type_id": "550e8400-e29b-41d4-a716-446655440010"
}
],
"timestamp_column": "exposed_at",
"variant_column": "variant"
},
"type": "exposure-sql-models"
}
}Response
Created
Example response
{
"data": {
"attributes": {
"created_at": "2024-01-01T12:00:00Z",
"experiment_column": "experiment_id",
"name": "Exposure events",
"properties": [
{
"column_name": "country",
"column_type": "STRING",
"id": "550e8400-e29b-41d4-a716-446655440031",
"name": "country",
"pipeline_column_suffix": "cty001"
}
],
"sql": "SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures",
"subject_types": [
{
"column_name": "user_id",
"subject_type_id": "550e8400-e29b-41d4-a716-446655440010"
}
],
"timestamp_column": "exposed_at",
"updated_at": "2024-01-01T12:00:00Z",
"variant_column": "variant"
},
"id": "550e8400-e29b-41d4-a716-446655440030",
"type": "exposure-sql-models"
}
}Changes
Changes to this operation have not been checked yet.