---
title: "List exposure SQL models"
method: GET
path: "/api/v2/experiments/exposure-sql-models"
tags: ["Experiments"]
---

# List exposure SQL models

`GET /api/v2/experiments/exposure-sql-models`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/experiments/exposure-sql-models`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `product_analytics_metrics_read`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/experiments/exposure-sql-models/get.ts> (a function with typed inputs; its response is checked against the schema)

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.

## Query parameters

- `include` string[]: Optional fields to include. Repeat this parameter to request several fields. `counts` adds experiment_count, which costs an extra aggregate query.
- `include_archived` boolean: 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.
- `page[offset]` integer: Number of results to skip for pagination. Defaults to 0 when omitted.
- `search` string: Find exposure SQL models whose names contain the search text, regardless of case.
- `sort` string: Sort field: name, created_at, or updated_at. Prefix with `-` for descending (for example, `-created_at`). Defaults to created_at descending.

## Response `200`

OK

- ExperimentsExposureSQLModelV2DTOArray: Response containing a page of exposure SQL models.
  - `data` ExperimentsExposureSQLModelV2DTOData[], required: Exposure SQL models in the current page.
    - `attributes` ExperimentsExposureSQLModelV2DTODataAttributes: Query and column mappings used to read experiment assignment data.
      - `archived_at` string, date-time, nullable: Time when the exposure SQL model was archived.
      - `created_at` string, date-time: Time when the exposure SQL model was created.
      - `date_partition_column` string, nullable: Column used to identify date partitions in the exposure data.
      - `experiment_column` string: SQL result column that contains the experiment key.
      - `experiment_count` integer, nullable: Number of experiments associated with the exposure SQL model.
      - `migration_metadata` unknown
      - `name` string: Display name of the exposure SQL model.
      - `properties` ExperimentsExposureSQLModelV2DTODataAttributesItems[]: Property columns available for filtering or splitting exposure data.
        - `column_name` string: SQL result column that contains this property.
        - `column_type` string: Data type of the property column.
        - `description` string: Description of the exposure property.
        - `id` string: Identifier of the exposure property.
        - `migration_metadata` unknown
        - `name` string: Display name of the exposure property.
        - `pipeline_column_suffix` string: Suffix used for this property column in the analysis pipeline.
      - `sql` string: SQL query that supplies the experiment assignment data.
      - `subject_types` ExperimentsCreateExposureSQLModelV2RequestDataAttributesSubjectTypesItems[]: Mappings between subject types and their identifier columns.
        - `column_name` string, required: SQL result column that contains the subject identifier.
        - `subject_type_id` string, required: Identifier of the subject type mapped to this column.
      - `timestamp_column` string: SQL result column that contains the assignment timestamp.
      - `updated_at` string, date-time: Time when the exposure SQL model was last updated.
      - `variant_column` string: SQL result column that contains the assigned variant.
    - `id` string, uuid, required: Identifier of the exposure SQL model.
    - `type` 'exposure-sql-models', required: Exposure SQL models resource type.
  - `links` ExperimentsOffsetLinks: Links for navigating a paginated result set.
    - `first` string: URL of the first page of results.
    - `last` string: URL of the last page of results.
    - `next` string: URL of the next page of results.
    - `prev` string: URL of the previous page of results.
    - `self` string: URL of the current page of results.
  - `meta` ExperimentsOffsetMeta: Pagination information for a list response.
    - `page` ExperimentsOffsetMetaPage: Result counts and offsets for a page of results.
      - `first_offset` integer: Offset of the first page of results.
      - `last_offset` integer, nullable: Offset of the last page of results.
      - `limit` integer: Maximum number of results returned in one page.
      - `next_offset` integer, nullable: Offset of the next page of results.
      - `offset` integer: Number of results skipped before this page.
      - `prev_offset` integer, nullable: Offset of the previous page of results.
      - `total` integer, nullable: Total number of matching results across all pages.
      - `type` string: Pagination method used for this result set.

## Other responses

- `400`: Invalid query parameter: bad page[offset]/page[limit], search longer than 1024 bytes, unknown sort field, non-boolean include_archived, or unknown include value.
- `401`: Missing or invalid authentication (dd-api-key + dd-application-key headers, or a valid user session).
- `403`: Authenticated caller lacks the product_analytics_metrics_read permission.
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
