> ## Documentation Index
> Fetch the complete documentation index at: https://confidence-auth-testing.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Assignment Tables

> Learn how to create assignment tables using the API.

**Create Assignment Tables**

Learn how to create assignment tables using the API.

[Do this in the app →](/docs/capabilities/metrics/create-assignment-table.md)

Create assignment tables that store records of what entities have been assigned what configuration.

## Before You Begin

Before creating an assignment table, ensure you have:

* An API access token with appropriate permissions
* Created the entity you want to track assignments for
* Prepared a SQL query that selects assignment rows from your data warehouse
* Identified the columns for timestamp, entity ID, exposure key, and variant key

## Create an Assignment Table

Create an assignment table with automatic data delivery:

```bash theme={null}
curl -X POST "https://metrics.confidence.dev/v1/assignmentTables" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "displayName": "My Assignment Table",
    "dataDeliveredUntilUpdateStrategyConfig": {
      "strategy": "AUTOMATIC",
      "automaticUpdateConfig": {
        "incrementDuration": "P13H",
        "commitDelay": "P13H"
      }
    },
    "sql": "SELECT * FROM my_table",
    "entityColumnMapping": {
      "column": {
        "name": "user_id"
      },
      "entity": "entities/user"
    },
    "timestampColumn": {
      "name": "timestamp"
    },
    "exposureKeyColumn": {
      "name": "experiment_id"
    },
    "variantKeyColumn": {
      "name": "group"
    }
  }'
```

## Column Mapping Fields

* **entityColumnMapping**: Maps the column containing entity IDs to the entity resource
  * `column.name`: Name of the column in your query results
  * `entity`: Resource name of the entity (for example, `entities/user`)
* `timestampColumn`: Column containing the assignment timestamp
* `exposureKeyColumn`: Column identifying which experiment the assignment belongs to
* `variantKeyColumn`: Column identifying which variant was assigned

## Data Delivery Strategy

Configure how Confidence updates data from your warehouse:

**Automatic Updates**

```json theme={null}
"dataDeliveredUntilUpdateStrategyConfig": {
  "strategy": "AUTOMATIC",
  "automaticUpdateConfig": {
    "incrementDuration": "P13H",
    "commitDelay": "P13H"
  }
}
```

* **incrementDuration**: How frequently to check for new data
* **commitDelay**: Buffer time before considering data complete

**Daily Updates**

```json theme={null}
"dataDeliveredUntilUpdateStrategyConfig": {
  "strategy": "DAILY",
  "dailyUpdateConfig": {}
}
```

Updates once per day at a scheduled time.

## Next Steps

After creating an assignment table:

* [Create fact tables](/docs/reference/api/how-to-guides/metrics/create-fact-table.md) to measure outcomes
* [Create metrics](/docs/reference/api/how-to-guides/metrics/create-metric.md) using your assignment and fact tables
* Configure experiments to use this assignment table
