---
title: "Update Prompt"
method: PATCH
path: "/api/v1/prompts/{prompt_id}"
tags: ["Basics"]
---

# Update Prompt

`PATCH /api/v1/prompts/{prompt_id}`

Updates a prompt's metadata (text, type, volume, topic, geography, locations). Only the supplied fields change. Returns a before/after snapshot.

A prompt's **text** (`prompt`) can only be changed while the prompt has not streamed any responses yet. Once it has responses, sending a changed `prompt` returns `400` — delete the prompt and create a new one instead. All other fields (type, volume, topic, geography, locations) remain editable at any time, and re-sending the existing text unchanged is always allowed.

## Path parameters

- `prompt_id` string, uuid, required

## Request body

- object
  - `website_id` string, uuid, required — Website that owns the prompt.
  - `prompt` string — New prompt text. Trimmed; blank is rejected. Editable only while the prompt has no responses yet — changing it after responses have streamed returns `400`. Re-sending the current text unchanged (e.g. in a full-object PATCH) is always allowed, as are metadata-only edits.
  - `type` 'discovery' | 'high_intent', nullable
  - `volume` string, nullable
  - `topic_id` string, uuid, nullable
  - `countries` string[]
  - `primary_country` string, nullable — When `countries` is non-empty it must be one of them.
  - `location_ids` string[]

## Response `200`

Prompt updated

- object
  - `id` string, uuid
  - `text` string
  - `type` string, nullable
  - `volume` string, nullable
  - `topic_id` string, nullable
  - `locations` object[]
    - `id` string, uuid
    - `name` string
  - `countries` string[]
  - `before` object — Pre-update snapshot.
    - `text` string
    - `type` string, nullable
    - `volume` string, nullable
    - `topic_id` string, nullable
    - `countries` string[]
    - `location_ids` string[]

## Other responses

- `400` — Bad request - Validation error
- `401` — Unauthorized - Invalid or missing API key
- `403` — Forbidden - You don't have access to this website
- `404` — Not found - Prompt not found, deleted, or on another website
- `500` — Internal server error

---

[API](https://skmtc.net/athenahq/apis/athenahq-api.md) · [All operations](https://skmtc.net/athenahq/apis/athenahq-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/athenahq/athenahq-api/versions/6c5d71622cb9/schema)
