---
title: "Replaces a benchmark's prompt structure with the submitted one."
method: PUT
path: "/benchmark/{benchmarkId}/prompt-structure"
tags: ["Benchmark"]
---

# Replaces a benchmark's prompt structure with the submitted one.

`PUT /benchmark/{benchmarkId}/prompt-structure`

Prompts that would no longer satisfy the structure are only removed when
 deleteInvalidPrompts is set; otherwise the request is rejected with a message naming
 how many would have to go. Deleting them also removes the samples and generation items they
 produced. Returns 409 when a leaderboard's rapid context, or the benchmark's HuggingFace
 export configuration, still references a segment the new structure removes or retypes.
 Content stored under a removed segment is discarded.

## Path parameters

- `benchmarkId` string, required

## Request body

- ApplyPromptStructureEndpointInput
  - `segments` PromptSegmentDefinition[], required — The complete replacement structure, in render order.
    - `key` string, required
    - `kind` 'Text' | 'Asset', required
    - `label` string, required
    - `required` boolean, required
  - `deleteInvalidPrompts` boolean — Whether prompts the new structure invalidates may be deleted. Defaults to false, which refuses the change and reports how many prompts would have to go.

## Response `200`

OK

- ApplyPromptStructureEndpointOutput
  - `deletedPromptCount` integer, required — How many prompts were deleted to satisfy the new structure.

## 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/:benchmarkId/prompt-structure/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)
