> 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/distill.md).

# Distill

Distill allows you to leverage your user's [identifiers & traits](/attuitive/basics/identifiers-and-traits.md) to refine users into helpful summaries & insights. Raw data is transformed into intelligence for improved analytics and decision making.

## Distill user

<mark style="color:green;">`GET`</mark> `/distill/:userId`

Distill a known user

Generating a distillation can take a few seconds. Attuitive will **cache** a user's distillation summary, significantly reducing the duration of subsequent requests. **Only** if the information of a user has changed will a new distillation be generated. You can override this behaviour with the `refresh` query parameter if required.

> **TIP:** Requesting cached distillations will not be counted as an intelligence event.&#x20;

**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}`                                                                     |
| `refresh`                                   | string | Whether a new distillation should be generated, regardless of if a current one exists. `true` or `false`. |

**Response**

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

```json
{
  "new": true // Whether this is a newly generated distillation
  "id": "usr_dst_XXX",
  "workspaceId": "ws_XXX",
  "user_id": "usr_XXX",
  "summary": "Jane is a 34-year-old customer based in San Francisco, CA. She has spent over $1,200 with the brand and typically places medium-sized orders. Jane is..."
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "status": 404,
  "message": "User with ID not found",
  "moreInfo": "A user with the provided ID does not exist."
}
```

{% endtab %}
{% endtabs %}

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