---
title: "Attach attributes (for example the signed-in user's id, name and email) to a visitor."
method: PUT
path: "/analytics/visitors/{visitor_id}/enrich"
tags: ["Analytics"]
---

# Attach attributes (for example the signed-in user's id, name and email) to a visitor.

`PUT /analytics/visitors/{visitor_id}/enrich`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/analytics/visitors/{visitor_id}/enrich`
- Auth: HTTP bearer

The top-level keys of `custom_data` are merged into what is already stored;
a key set to `null` is removed. A deployed app can call this with its
injected deployment token (permission `visitors:enrich`), using the sealed
`enc_…` value of the `_temps_visitor_id` cookie, for visitors of its own
project only.

## Path parameters

- `visitor_id` string, required

## Request body

- EnrichVisitorRequest
  - `custom_data` object, required: Attributes to attach to the visitor. Top-level keys are merged into the visitor's stored `custom_data`; a key whose value is `null` removes that key. Deployment tokens may send at most 32 keys and 8 KB.

## Response `200`

Enrichment result. `success: false` means the visitor was not found (or is not in the caller's project) and nothing was changed.

- EnrichVisitorResponse
  - `message` string, required
  - `success` boolean, required
  - `visitor_id` string, required

## Other responses

- `400`: Invalid visitor ID, or enrichment data that is not a JSON object within the size limits
- `403`: Deployment token used with a non-encrypted visitor ID
- `429`: The deployment token made too many visitor-changing enrichments in the last minute; retry shortly
- `500`: Internal server error

## Changes

- **2026-10-05** `4b228ebed583`: 1 warning, 3 info
  - deleted the `query` request parameter `project_id`
  - added the non-success response with the status `403`
  - added the non-success response with the status `429`
  - removed the non-success response with the status `404`
- **2026-10-05** `63a80791dc58`: 1 breaking, 3 info
  - added the new required `query` request parameter `project_id`
  - added the non-success response with the status `404`
  - removed the non-success response with the status `403`
  - removed the non-success response with the status `429`
- **2026-09-21** `9147bd301b1d`: 1 warning, 3 info
  - deleted the `query` request parameter `project_id`
  - added the non-success response with the status `403`
  - added the non-success response with the status `429`
  - removed the non-success response with the status `404`
- **2026-01-11** `50604ba8d4a8`: 1 info
  - for the `path` request parameter `visitor_id`, the type was generalized from `integer` to `string`, and format from `int32` to no format

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/analytics/visitors/:visitor_id/enrich/put.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
