---
title: "Replaces a prompt's content with the submitted segments."
method: PUT
path: "/benchmark-prompt/{promptId}/segments"
tags: ["Prompt"]
---

# Replaces a prompt's content with the submitted segments.

`PUT /benchmark-prompt/{promptId}/segments`

The replacement is complete: a segment the benchmark defines but the payload leaves out is
 cleared. Returns 400 when the content names an unknown segment or leaves a required one
 empty.

## Path parameters

- `promptId` string, required

## Request body

- ReplacePromptSegmentsEndpointInput
  - `segments` PromptSegmentInput[], required — The prompt's complete content.
    - `key` string, required
    - `kind` 'Text' | 'Asset', required
    - `text` string, nullable
    - `asset` union
      - IAssetInputExistingAssetInput
        - `_t` 'ExistingAssetInput', required
        - `name` string, required
        - `metadata` object, nullable
        - `identifier` string, nullable
      - IAssetInputMultiAssetInput
        - `_t` 'MultiAssetInput', required
        - `assets` IAssetInput[], required
          - union
            - object
              - …
            - object
              - …
            - object
              - …
        - `metadata` object, nullable
        - `identifier` string, nullable
      - IAssetInputTextAssetInput
        - `_t` 'TextAssetInput', required
        - `text` string, required
        - `metadata` object, nullable
        - `identifier` string, nullable

## Response `204`

No Content

## Other responses

- `400` — Bad Request
- `401` — Unauthenticated
- `403` — Forbidden

## Changes

- **2026-09-15** `ebc7fbc31114` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/rapidata/apis/rapidata-api/changes/benchmark-prompt/:promptId/segments/put.md)

---

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