> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rankraft.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update prompts

> PATCH /v1/sites/{site_id}/prompts

> [!NOTE]
>
> Needs a key with **Read and manage prompts** access. Counts against the write limit of 20 requests a minute.

Change a prompt's category or market. Text cannot be edited: a reworded question is a different question, so disable the old prompt and create a new one, which keeps answer history comparable.

## Path parameters

**site\_id** `string` *required*

The site's id, from [List sites](/api-reference/endpoints/list-sites).

## Body

**prompts** `object[]` *required*

1 to 100 changes.

**properties**

**id** `string` *required*

The prompt's id.

**category** `enum\<string\>`

One of: `Discovery`, `Comparison`, `Alternatives`, `How-to`, `Pricing`, `Brand`.

**market** `string`

New location, or null to use the site's market.

**dry\_run** `boolean` (default: false)

Validate and report without writing.

## Response

**dry\_run** `boolean`

**not\_found** `string[]`

Ids that are not prompts of this site. The rest of the request still applies.

**data** `object[]`

The updated prompts.

**properties**

**id** `string`

**text** `string`

**category** `enum\<string\>`

One of: `Discovery`, `Comparison`, `Alternatives`, `How-to`, `Pricing`, `Brand`.

**market** `string`

**status** `enum\<string\>`

One of: `active`, `disabled`.

**created\_at** `string`

**updated\_at** `string`

```bash cURL theme={"system"}
curl -X PATCH https://api.rankraft.ai/v1/sites/3f2c9a10-7b1e-4c55-9d2a-1a2b3c4d5e6f/prompts \
  -H "X-API-Key: $RANKRAFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompts": [
      { "id": "8a1e4b2c-6d0f-4e3a-9b51-2c7d8e9f0a1b", "category": "Comparison", "market": "Pakistan" }
    ]
  }'
```

```javascript JavaScript theme={"system"}
// npm install rankraft-js · https://www.npmjs.com/package/rankraft-js
import { RankRaft } from "rankraft-js";

const rr = new RankRaft(); // reads RANKRAFT_API_KEY (needs "Read and manage prompts")

const result = await rr.prompts.update({
  site_id: "3f2c9a10-7b1e-4c55-9d2a-1a2b3c4d5e6f",
  prompts: [{ id: "8a1e4b2c-6d0f-4e3a-9b51-2c7d8e9f0a1b", category: "Comparison", market: "Pakistan" }],
});
console.log(result.data, result.not_found);
```

```python Python theme={"system"}
# pip install rankraft-py · https://pypi.org/project/rankraft-py/
from rankraft import RankRaft

with RankRaft() as rr:  # reads RANKRAFT_API_KEY (needs "Read and manage prompts")
    result = rr.prompts.update(
        site_id="3f2c9a10-7b1e-4c55-9d2a-1a2b3c4d5e6f",
        prompts=[{"id": "8a1e4b2c-6d0f-4e3a-9b51-2c7d8e9f0a1b", "category": "Comparison", "market": "Pakistan"}],
    )
    print(result["data"], result["not_found"])
```

```json 200 theme={"system"}
{
  "dry_run": false,
  "not_found": [],
  "data": [
    {
      "id": "8a1e4b2c-6d0f-4e3a-9b51-2c7d8e9f0a1b",
      "text": "best mixed pickle brand",
      "category": "Comparison",
      "market": "Pakistan",
      "status": "active",
      "created_at": "2026-09-02T08:12:00.000Z",
      "updated_at": "2026-10-16T09:00:00.000Z"
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.