GET
/
v1
/
attribute-definitions
# List attribute definitions for specific events
curl https://api.usertour.io/v1/attribute-definitions?scope=eventDefinition&eventName%5B%5D=page_viewed&eventName%5B%5D=flow_started&limit=3 \
-H 'Authorization: Bearer ak_123456789' \
-H 'Content-Type: application/json'
{
  "results": [
    {
      "id": "cm9e922or000jmjaox6ynbld2",
      "object": "attributeDefinition",
      "createdAt": "2025-04-12T13:26:30.939Z",
      "dataType": "string",
      "description": "Usertour flow id",
      "displayName": "Flow ID",
      "codeName": "flow_id",
      "scope": "eventDefinition"
    },
    {
      "id": "cm9e922or000kmjao3nhw7w74",
      "object": "attributeDefinition",
      "createdAt": "2025-04-12T13:26:30.939Z",
      "dataType": "string",
      "description": "Usertour flow name",
      "displayName": "Flow Name",
      "codeName": "flow_name",
      "scope": "eventDefinition"
    },
    {
      "id": "cm9e922or000lmjao49o5mwwf",
      "object": "attributeDefinition",
      "createdAt": "2025-04-12T13:26:30.939Z",
      "dataType": "string",
      "description": "A session of a specific user viewing a specific flow",
      "displayName": "Flow Session ID",
      "codeName": "flow_session_id",
      "scope": "eventDefinition"
    }
  ],
  "next": "/v1/attribute-definitions?scope=eventDefinition&eventName%5B%5D=page_viewed&eventName%5B%5D=flow_started&limit=3&cursor=cm9e922or000lmjao49o5mwwf",
  "previous": null
}

This endpoint returns a paginated list of attribute definitions. Each definition object contains its data type, scope, and metadata.

Query parameters

scope
string

Filter definitions by their scope. Available scopes:

  • eventDefinition: Event-related attributes
  • company: Company-related attributes
  • companyMembership: Company membership attributes
  • user: User-related attributes
eventName
string | string[]

Filter definitions by event name(s). You can provide:

  • Single value: eventName=page_viewed
  • Multiple values: eventName[]=page_viewed&eventName[]=clicked
orderBy
string | string[]

Sort the results by one or more fields. Available fields:

  • createdAt: Creation timestamp
  • codeName: Technical name
  • displayName: Display name

Examples:

  • Single field: orderBy=createdAt or orderBy=-createdAt (descending)
  • Multiple fields: orderBy[]=-createdAt&orderBy[]=name
limit
number
default:"20"

Specifies the maximum number of items to return in a single response. The value must be between 1 and 100. If not specified, defaults to 20 items per page.

cursor
string

Specifies the starting point for the next page of results. The response will include items that come after (but not including) the object with this ID. To get the next page, use the ID of the last item from your previous request. The easiest way is to use the list object’s cursor field. If not provided, the API will return items from the beginning of the list.

Response

Returns a list object containing an array of attribute definition objects in the results property. The response includes pagination information in the next and previous fields.

# List attribute definitions for specific events
curl https://api.usertour.io/v1/attribute-definitions?scope=eventDefinition&eventName%5B%5D=page_viewed&eventName%5B%5D=flow_started&limit=3 \
-H 'Authorization: Bearer ak_123456789' \
-H 'Content-Type: application/json'
{
  "results": [
    {
      "id": "cm9e922or000jmjaox6ynbld2",
      "object": "attributeDefinition",
      "createdAt": "2025-04-12T13:26:30.939Z",
      "dataType": "string",
      "description": "Usertour flow id",
      "displayName": "Flow ID",
      "codeName": "flow_id",
      "scope": "eventDefinition"
    },
    {
      "id": "cm9e922or000kmjao3nhw7w74",
      "object": "attributeDefinition",
      "createdAt": "2025-04-12T13:26:30.939Z",
      "dataType": "string",
      "description": "Usertour flow name",
      "displayName": "Flow Name",
      "codeName": "flow_name",
      "scope": "eventDefinition"
    },
    {
      "id": "cm9e922or000lmjao49o5mwwf",
      "object": "attributeDefinition",
      "createdAt": "2025-04-12T13:26:30.939Z",
      "dataType": "string",
      "description": "A session of a specific user viewing a specific flow",
      "displayName": "Flow Session ID",
      "codeName": "flow_session_id",
      "scope": "eventDefinition"
    }
  ],
  "next": "/v1/attribute-definitions?scope=eventDefinition&eventName%5B%5D=page_viewed&eventName%5B%5D=flow_started&limit=3&cursor=cm9e922or000lmjao49o5mwwf",
  "previous": null
}