---
title: "POST /configuredTables/{configuredTableIdentifier}/analysisRule"
method: POST
path: "/configuredTables/{configuredTableIdentifier}/analysisRule"
---

# POST /configuredTables/{configuredTableIdentifier}/analysisRule

`POST /configuredTables/{configuredTableIdentifier}/analysisRule`

Creates a new analysis rule for a configured table. Currently, only one analysis rule can be created for a given configured table.

## Path parameters

- `configuredTableIdentifier` string, required

## Request body

- object
  - `analysisRuleType` 'AGGREGATION' | 'LIST' | 'CUSTOM', required — The type of analysis rule.
  - `analysisRulePolicy` object, required — Controls on the query specifications that can be run on a configured table.
    - `v1` object — Controls on the query specifications that can be run on a configured table.
      - `list` object — Analysis rule type that enables only list queries on a configured table.
        - `joinColumns` AnalysisRuleColumnName[], required — Columns that can be used to join a configured table with the table of the member who can query and other members' configured tables.
        - `allowedJoinOperators` JoinOperator[] — The logical operators (if any) that are to be used in an INNER JOIN match condition. Default is <code>AND</code>.
        - `listColumns` AnalysisRuleColumnName[], required — Columns that can be listed in the output.
        - `additionalAnalyses` 'ALLOWED' | 'REQUIRED' | 'NOT_ALLOWED' — An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the direct query.
      - `aggregation` object — Analysis rule type that enables only aggregation queries on a configured table.
        - `aggregateColumns` AggregateColumn[], required — The columns that query runners are allowed to use in aggregation queries.
          - `columnNames` AnalysisRuleColumnName[], required — Column names in configured table of aggregate columns.
          - `function` 'SUM' | 'SUM_DISTINCT' | 'COUNT' | 'COUNT_DISTINCT' | 'AVG', required — Aggregation function that can be applied to aggregate column in query.
        - `joinColumns` AnalysisRuleColumnName[], required — Columns in configured table that can be used in join statements and/or as aggregate columns. They can never be outputted directly.
        - `joinRequired` 'QUERY_RUNNER' — Control that requires member who runs query to do a join with their configured table and/or other configured table in query.
        - `allowedJoinOperators` JoinOperator[] — Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is <code>AND</code>.
        - `dimensionColumns` AnalysisRuleColumnName[], required — The columns that query runners are allowed to select, group by, or filter by.
        - `scalarFunctions` ScalarFunctions[], required — Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation of metrics.
        - `outputConstraints` AggregationConstraint[], required — Columns that must meet a specific threshold value (after an aggregation function is applied to it) for each output row to be returned.
          - `columnName` string, required — Column in aggregation constraint for which there must be a minimum number of distinct values in an output row for it to be in the query output.
          - `minimum` integer, required — The minimum number of distinct values that an output row must be an aggregation of. Minimum threshold of distinct values for a specified column that must exist in an output row for it to be in the query output.
          - `type` 'COUNT_DISTINCT', required — The type of aggregation the constraint allows. The only valid value is currently `COUNT_DISTINCT`.
        - `additionalAnalyses` 'ALLOWED' | 'REQUIRED' | 'NOT_ALLOWED' — <p> An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the direct query. </p> <p>The <code>additionalAnalyses</code> parameter is currently supported for the list analysis rule (<code>AnalysisRuleList</code>) and the custom analysis rule (<code>AnalysisRuleCustom</code>).</p>
      - `custom` AnalysisRuleCustom — A type of analysis rule that enables the table owner to approve custom SQL queries on their configured tables. It supports differential privacy.
        - `allowedAnalyses` AnalysisTemplateArnOrQueryWildcard[], required — The ARN of the analysis templates that are allowed by the custom analysis rule.
        - `allowedAnalysisProviders` AccountId[] — The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when <code>allowedAnalyses</code> is <code>ANY_QUERY</code>.
        - `additionalAnalyses` 'ALLOWED' | 'REQUIRED' | 'NOT_ALLOWED' — An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the direct query.
        - `disallowedOutputColumns` AnalysisRuleColumnName[] — A list of columns that aren't allowed to be shown in the query output.
        - `differentialPrivacy` object — The differential privacy configuration.
          - `columns` DifferentialPrivacyColumn[], required — The name of the column (such as user_id) that contains the unique identifier of your users whose privacy you want to protect. If you want to turn on diﬀerential privacy for two or more tables in a collaboration, you must conﬁgure the same column as the user identiﬁer column in both analysis rules.
            - `name` string, required — The name of the column, such as user_id, that contains the unique identifier of your users, whose privacy you want to protect. If you want to turn on differential privacy for two or more tables in a collaboration, you must configure the same column as the user identifier column in both analysis rules.
        - `allowedResultReceivers` AccountId[] — The list of Amazon Web Services account IDs that are allowed to receive results from queries run on the configured table.
        - `allowedAdditionalAnalyses` AdditionalAnalysesResourceArn[] — The list of allowed additional analyses for the custom analysis rule.

## Response `200`

Success

- CreateConfiguredTableAnalysisRuleOutput
  - `analysisRule` object, required — The analysis rule that was created for the configured table.
    - `configuredTableId` string, required — The unique ID for the configured table.
    - `configuredTableArn` string, required — The unique ARN for the configured table.
    - `policy` object, required — The policy that controls SQL query rules.
      - `v1` object — Controls on the query specifications that can be run on a configured table.
        - `list` object — Analysis rule type that enables only list queries on a configured table.
          - `joinColumns` AnalysisRuleColumnName[], required — Columns that can be used to join a configured table with the table of the member who can query and other members' configured tables.
          - `allowedJoinOperators` JoinOperator[] — The logical operators (if any) that are to be used in an INNER JOIN match condition. Default is <code>AND</code>.
          - `listColumns` AnalysisRuleColumnName[], required — Columns that can be listed in the output.
          - `additionalAnalyses` 'ALLOWED' | 'REQUIRED' | 'NOT_ALLOWED' — An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the direct query.
        - `aggregation` object — Analysis rule type that enables only aggregation queries on a configured table.
          - `aggregateColumns` AggregateColumn[], required — The columns that query runners are allowed to use in aggregation queries.
            - `columnNames` AnalysisRuleColumnName[], required — Column names in configured table of aggregate columns.
            - `function` 'SUM' | 'SUM_DISTINCT' | 'COUNT' | 'COUNT_DISTINCT' | 'AVG', required — Aggregation function that can be applied to aggregate column in query.
          - `joinColumns` AnalysisRuleColumnName[], required — Columns in configured table that can be used in join statements and/or as aggregate columns. They can never be outputted directly.
          - `joinRequired` 'QUERY_RUNNER' — Control that requires member who runs query to do a join with their configured table and/or other configured table in query.
          - `allowedJoinOperators` JoinOperator[] — Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is <code>AND</code>.
          - `dimensionColumns` AnalysisRuleColumnName[], required — The columns that query runners are allowed to select, group by, or filter by.
          - `scalarFunctions` ScalarFunctions[], required — Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation of metrics.
          - `outputConstraints` AggregationConstraint[], required — Columns that must meet a specific threshold value (after an aggregation function is applied to it) for each output row to be returned.
            - `columnName` string, required — Column in aggregation constraint for which there must be a minimum number of distinct values in an output row for it to be in the query output.
            - `minimum` integer, required — The minimum number of distinct values that an output row must be an aggregation of. Minimum threshold of distinct values for a specified column that must exist in an output row for it to be in the query output.
            - `type` 'COUNT_DISTINCT', required — The type of aggregation the constraint allows. The only valid value is currently `COUNT_DISTINCT`.
          - `additionalAnalyses` 'ALLOWED' | 'REQUIRED' | 'NOT_ALLOWED' — <p> An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the direct query. </p> <p>The <code>additionalAnalyses</code> parameter is currently supported for the list analysis rule (<code>AnalysisRuleList</code>) and the custom analysis rule (<code>AnalysisRuleCustom</code>).</p>
        - `custom` AnalysisRuleCustom — A type of analysis rule that enables the table owner to approve custom SQL queries on their configured tables. It supports differential privacy.
          - `allowedAnalyses` AnalysisTemplateArnOrQueryWildcard[], required — The ARN of the analysis templates that are allowed by the custom analysis rule.
          - `allowedAnalysisProviders` AccountId[] — The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when <code>allowedAnalyses</code> is <code>ANY_QUERY</code>.
          - `additionalAnalyses` 'ALLOWED' | 'REQUIRED' | 'NOT_ALLOWED' — An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the direct query.
          - `disallowedOutputColumns` AnalysisRuleColumnName[] — A list of columns that aren't allowed to be shown in the query output.
          - `differentialPrivacy` object — The differential privacy configuration.
            - `columns` DifferentialPrivacyColumn[], required — The name of the column (such as user_id) that contains the unique identifier of your users whose privacy you want to protect. If you want to turn on diﬀerential privacy for two or more tables in a collaboration, you must conﬁgure the same column as the user identiﬁer column in both analysis rules.
              - …
          - `allowedResultReceivers` AccountId[] — The list of Amazon Web Services account IDs that are allowed to receive results from queries run on the configured table.
          - `allowedAdditionalAnalyses` AdditionalAnalysesResourceArn[] — The list of allowed additional analyses for the custom analysis rule.
    - `type` 'AGGREGATION' | 'LIST' | 'CUSTOM', required — The type of configured table analysis rule.
    - `createTime` string, date-time, required — The time the configured table analysis rule was created.
    - `updateTime` string, date-time, required — The time the configured table analysis rule was last updated.

## Other responses

- `480` — ConflictException
- `481` — ServiceQuotaExceededException
- `482` — ResourceNotFoundException
- `483` — InternalServerException
- `484` — ValidationException
- `485` — ThrottlingException
- `486` — AccessDeniedException

---

[API](https://skmtc.net/aws/apis/cleanrooms.md) · [All operations](https://skmtc.net/aws/apis/cleanrooms/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/cleanrooms/versions/17ce59ba806e/schema)
