> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usertour.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List attribute definitions

> Retrieves a paginated list of attribute definitions in your account. Each definition includes its data type, scope, and metadata.

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

## Query parameters

<ParamField path="scope" type="string">
  Filter definitions by their scope. Available scopes:

  * `eventDefinition`: Event-related attributes
  * `company`: Company-related attributes
  * `companyMembership`: Company membership attributes
  * `user`: User-related attributes
</ParamField>

<ParamField path="eventName" type="string | string[]">
  Filter definitions by event name(s). You can provide:

  * Single value: `eventName=page_viewed`
  * Multiple values: `eventName[]=page_viewed&eventName[]=clicked`
</ParamField>

<ParamField path="orderBy" type="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`
</ParamField>

<ParamField query="limit" type="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.
</ParamField>

<ParamField query="cursor" type="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](#the-list-object) cursor field. If not provided, the API will return items from the beginning of the list.
</ParamField>

## Response

Returns a [list object](/api-reference/pagination#the-list-object) containing an array of [attribute definition objects](/api-reference/attribute-definitions/model) in the `results` property. The response includes pagination information in the `next` and `previous` fields.

<RequestExample>
  ```bash Request theme={null}
  # 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'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "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
  }
  ```
</ResponseExample>
