---
title: "Set one metadata attribute"
method: PUT
path: "/api/v1/stimuli/{stimulus_id}/metadata/{key}"
tags: ["Stimuli"]
---

# Set one metadata attribute

`PUT /api/v1/stimuli/{stimulus_id}/metadata/{key}`

## Request

- Base URL: `https://app.voicepanel.com`
- URL: `https://app.voicepanel.com/api/v1/stimuli/{stimulus_id}/metadata/{key}`
- Auth: HTTP bearer

Set a single attribute, leaving the rest of the stimulus's metadata alone. An object value is flattened under the key and replaces anything already nested there; a null value removes the key.

## Path parameters

- `stimulus_id` string, required
- `key` string, required

## Request body

- StimulusMetadataKeyBody: Set a single metadata key on a stimulus
  - `value` union, required: The value to store — a string, a number, a boolean, or an array of strings and numbers. An object is flattened under the key, replacing anything already nested there. Null removes the key.
    - string
    - number
    - boolean
    - unknown[]
      - unknown
    - object

## Response `200`

Successful response

- StimulusMetadata: A stimulus with its metadata
  - `id` string, required: The stimulus ID
  - `study_id` string, nullable, required: ID of the study the stimulus belongs to
  - `metadata` object, required: Flat attributes. A key maps to a string, a number, a boolean, or a list of strings and numbers.

## Other responses

- `400`: Bad request. `code` is `validation_error` when a field is invalid or a query parameter is unknown, with the field paths in `details`, or `bad_request` otherwise.
- `401`: Unauthorized. The token is missing, invalid, or has no user.
- `403`: Forbidden. The token has no access to this resource.
- `404`: Not found. The resource does not exist or belongs to another account.
- `409`: Conflict. The write disagrees with the current state of the resource.
- `429`: Too many requests. The account used its API rate limit. `code` is `too_many_requests`. Wait for the number of seconds in `Retry-After`, then retry.
- `500`: Internal error. Quote `request_id` when you contact support.
- `503`: Service unavailable. A dependency did not answer and nothing was saved. Retry later.

---

[API](https://skmtc.dev/voicepanel/apis/voicepanel-api.md) - [All operations](https://skmtc.dev/voicepanel/apis/voicepanel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/voicepanel/apis/voicepanel-api/revisions/ee41535c5694?raw)
