Skip to main content
POST
Create an attribute definition

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

projectId
string
required

Project ID

Body

application/json
scope
enum<string>
required

Which object the attribute belongs to: user, company, companyMembership, or eventDefinition (an event attribute — pre-defines an event property; attach it to events via the event-definitions surface. Tracking also auto-registers event properties at ingestion, so pre-defining is only needed to pin the type or attach before the first track).

Available options:
user,
company,
companyMembership,
eventDefinition
dataType
enum<string>
required

The attribute value type.

Available options:
number,
string,
boolean,
list,
datetime
codeName
string
required

Stable identifier, unique per project + scope. Immutable. Must start with a letter, then letters/digits/underscores, 2–100 chars.

Required string length: 2 - 100
Pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
displayName
string
required

Human-readable name.

Minimum string length: 1
description
string

Optional description.

Response

Attribute definition created

id
string
required
object
enum<string>
required
Available options:
attributeDefinition
predefined
boolean
required

Built-in attribute shipped by Usertour: it cannot be edited or deleted.

createdAt
string<date-time>
required
dataType
enum<string>
required

Value type. random_ab / random_number are SYSTEM-GENERATED bucketing types (stable per-user random values for splits) — they appear in reads and conditions but cannot be created through the API.

Available options:
number,
string,
boolean,
list,
datetime,
random_ab,
random_number
description
string
required
displayName
string
required
codeName
string
required
scope
enum<string>
required

Which object the attribute belongs to. eventDefinition = an event attribute (attach it to events via the event-definitions surface).

Available options:
user,
company,
companyMembership,
eventDefinition