> For the complete documentation index, see [llms.txt](https://tristans-organization-4.gitbook.io/attuitive/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tristans-organization-4.gitbook.io/attuitive/api-reference/track.md).

# Track

Track let's you build up a picture of your users. Data points on your users are called **Traits**. These are attributes you can derive insight from to drive decision making. `/track` provides the mechanism to record these attributes.

## Track attributes

<mark style="color:orange;">`POST`</mark> `/track/:userId`

Updates an existing user's traits.

Much like identifiers, traits use an **append & merge** approach. Properties will **override** an existing value if that key already, and any new properties will be added.

You do not need to send existing properties when updating, these will continue to be persisted (or overwritten per the above section). To remove a value, send the key and a `null` value. For example to remove `lastPurchaseDate`:

```json
{
    ...
    "lastPurchaseDate": null
}
```

**Headers**

| Name                                            | Value              |
| ----------------------------------------------- | ------------------ |
| Content-Type<mark style="color:red;">\*</mark>  | `application/json` |
| Authorization<mark style="color:red;">\*</mark> | `Bearer <token>`   |

**Query**

| Name                                        | Type   | Description                           |
| ------------------------------------------- | ------ | ------------------------------------- |
| `:userId`<mark style="color:red;">\*</mark> | string | ID of the user. `usr_[A-Za-z0-9]{16}` |

**Body**

| Name   | Type   | Description                                             |
| ------ | ------ | ------------------------------------------------------- |
| traits | object | An object containing identifying properties on the user |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "id": "usr_XXX",
  "workspaceId": "ws_XXX",
  "identifiers": {},
  "traits": {},
  "createdAt": "2025-04-05T00:10:41.840Z",
  "updatedAt": "2025-04-09T10:06:06.813Z"
}
```

{% endtab %}
{% endtabs %}

> **Important:** Fields with a `*` must be included in your request!
