Skip to main content

Documentation Index

Fetch the complete documentation index at: https://confidence.spotify.com/llms.txt

Use this file to discover all available pages before exploring further.

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:
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:
{
  "name": "entities/user",
  "displayName": "User",
  "primaryKeyType": "COLUMN_TYPE_STRING"
}

Create an Integer Entity

For entities with integer identifiers:
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: