---
title: "Update a prompt"
method: PATCH
path: "/v1/datasets/prompts/{id}"
tags: ["Datasets", "Prompts"]
---

# Update a prompt

`PATCH /v1/datasets/prompts/{id}`

## Request

- Base URL: `https://api.lunary.ai`
- URL: `https://api.lunary.ai/v1/datasets/prompts/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/lunary/apis/lunary-api/docs/v1/datasets/prompts/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `id` string, required

## Request body

- object
  - `messages` union
    - object[]
      - `role` string
      - `content` string
    - string

## Response `200`

Updated prompt

- DatasetPrompt
  - `id` string
  - `datasetId` string
  - `messages` union
    - object[]
      - `role` string
      - `content` string
    - string

---

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