---
title: "Name an element"
method: PUT
path: "/v1/projects/{projectId}/element-names"
tags: ["Element names"]
---

# Name an element

`PUT /v1/projects/{projectId}/element-names`

## Request

- Base URL: `https://hootlens-api-368877148687.us-east1.run.app`
- URL: `https://hootlens-api-368877148687.us-east1.run.app/v1/projects/{projectId}/element-names`
- Auth: HTTP bearer

Sets or replaces the name of one element, keyed by its selector. Plain words only: control characters are removed, whitespace collapses, and markup is refused with 400. A site can have 200 names. Needs an owner or editor; viewers and personal access tokens receive 403.

Required token scopes are listed in x-hootlens-scopes. A signed-in person needs the matching permission on the site instead (the viewer and editor roles are presets of the permissions).

## Path parameters

- `projectId` string, required: An identifier: 1 to 80 letters, digits, underscores or hyphens.

## Request body

- ElementNameInput
  - `key` string, required: The element's selector exactly as findings and heatmaps list it. A data-hoot-id selector is the stable one.
  - `name` string, required: What the team calls the element. Plain words, no markup.

## Response `200`

The name.

- object
  - `name` ElementDisplayName, required
    - `key` string, required: The element's selector, as findings and heatmaps list it.
    - `name` string, required: What the team calls the element.
    - `updatedAt` integer, required: Epoch milliseconds.
    - `updatedBy` string: The user who last set it.

## Other responses

- `400`: The request fields are invalid.
- `401`: The credential is missing, expired or revoked.
- `403`: The credential or the person's permissions on the site do not permit this action.
- `404`: The site, or the record inside it, does not exist or the caller is not a member (a non-member cannot tell the two apart).
- `429`: A rate limit or a per-site limit was reached.

---

[API](https://skmtc.dev/hootlens/apis/hoot-lens-api.md) · [All operations](https://skmtc.dev/hootlens/apis/hoot-lens-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hootlens/apis/hoot-lens-api/revisions/f64f8dc7b84e?raw)
