# 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!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tristans-organization-4.gitbook.io/attuitive/api-reference/distill.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
