Experiments

List exposure SQL models

List exposure SQL models. Returns a paginated list of the SQL models that experiment exposures are read from for the organization. Models maintained by Datadog are not included: they cannot be modified and cannot be used as an experiment's assignment source.

get/api/v2/experiments/exposure-sql-models

Request

Query parameters

includestring[]

Optional fields to include. Repeat this parameter to request several fields. counts adds experiment_count, which costs an extra aggregate query.

include_archivedboolean

When true, archived models are included in the result. Defaults to false, so archived models are hidden.

page[limit]integer

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.

page[offset]integer

Number of results to skip for pagination. Defaults to 0 when omitted.

searchstring

Find exposure SQL models whose names contain the search text, regardless of case.

sortstring

Sort field: name, created_at, or updated_at. Prefix with - for descending (for example, -created_at). Defaults to created_at descending.

Sort field: name, created_at, or updated_at. 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",
        "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.