---
title: "Edit one of my earlier prompts"
method: POST
path: "/v1/chat/messages/{messagePublicId}/edit"
tags: ["chat"]
---

# Edit one of my earlier prompts

`POST /v1/chat/messages/{messagePublicId}/edit`

## Request

- Base URL: `https://api.getmyhotels.com`
- URL: `https://api.getmyhotels.com/v1/chat/messages/{messagePublicId}/edit`
- Auth: HTTP bearer

Runs `chat.editMessage`; owner-only, user messages only. Writes a new row carrying `newText` and supersedes the original along with everything after it, so the conversation reads linearly from the edited prompt onward. Returns the new `newPublicId`, which the client sends as `parentMessagePublicId` on the turn it starts next so the fresh answer links to the edited prompt.

## Path parameters

- `messagePublicId` string, required

## Request body

- object
  - `newText` string, required

## Response `200`

Success

- unknown

## Other responses

- `400`: Request validation failed or the router rejected the input
- `401`: Missing or invalid bearer session token
- `404`: Resource not found
- `426`: Reported X-GMH-App-Version is below the supported minimum — the app must update
- `500`: Unexpected server error (opaque; details stay in logs)

---

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