> ## 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 Entities

> Learn how to create entities using the API.

**Create Entities**

Learn how to create entities using the API.

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

Create entities that can be uniquely identified and randomized, like users or sessions.

## Before You Begin

Before creating entities, ensure you have:

* An API access token with appropriate permissions
* Determined the data type of your entity identifier (string, integer, etc.)

## Create an Entity

To create an entity of type string called `User`:

```bash theme={null}
curl -X POST "https://metrics.confidence.dev/v1/entities" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "displayName": "User",
    "primaryKeyType": "COLUMN_TYPE_STRING"
  }'
```

The response includes the entity resource name you can use to reference it:

```json theme={null}
{
  "name": "entities/user",
  "displayName": "User",
  "primaryKeyType": "COLUMN_TYPE_STRING"
}
```

## Create an Integer Entity

For entities with integer identifiers:

```bash theme={null}
curl -X POST "https://metrics.confidence.dev/v1/entities" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "displayName": "Session",
    "primaryKeyType": "COLUMN_TYPE_INTEGER"
  }'
```

## Supported Primary Key Types

* `COLUMN_TYPE_STRING`: String identifiers (UUIDs, usernames, etc.)
* `COLUMN_TYPE_INTEGER`: Integer identifiers
* `COLUMN_TYPE_BOOLEAN`: Boolean values
* `COLUMN_TYPE_DOUBLE`: Floating point numbers

## Next Steps

After creating entities:

* [Create an assignment table](/docs/reference/api/how-to-guides/metrics/create-assignment-table.md) to track assignments
* [Create fact tables](/docs/reference/api/how-to-guides/metrics/create-fact-table.md) to measure entity behaviors
* [Create dimension tables](/docs/reference/api/how-to-guides/metrics/create-dimension-table.md) to segment entities
