---
title: "Updates an MCP prompt's fields, text or access."
---

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

Path: Sherpo merchant API › file

`PATCH /v1/stores/{store}/products/{product}/prompts/{prompt}`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `file:write`, `product:write`

## Path parameters

- `store` (`updatePrompt.path.store`; string, required) — The store's id.
- `product` (`updatePrompt.path.product`; string, required) — An id, or `slug:<slug>`.
  - minLength 1
- `prompt` (`updatePrompt.path.prompt`; string, required)
  - minLength 1

## Header parameters

- `Idempotency-Key` (`updatePrompt.header.Idempotency-Key`; string, optional) — Repeats within 24 hours answer the first result; the same key with other arguments is a conflict.
  - minLength 1; maxLength 255; pattern `^[\x21-\x7E]+$`

## Request body

_Optional._

- `name` (`updatePrompt.name`; string, optional) — A slash command, unique among the store's prompts.
  - minLength 1; maxLength 64; pattern `^[a-z0-9][a-z0-9-]*$`
- `title` (`updatePrompt.title`; string, optional)
  - minLength 1; maxLength 200
- `description` (`updatePrompt.description`; any of, optional)
  - any of: `string`, `null`
- `body` (`updatePrompt.body`; string, optional) — The prompt's markdown: 100000 bytes of UTF-8, so a quarter as many characters always fit.
  - minLength 1; maxLength 25000
- `access` (`updatePrompt.access`; any of, optional)
  - any of: `object`, `null`
- `arguments` (`updatePrompt.arguments`; array<object>, optional)
  - `name` (`updatePrompt.arguments.name`; string, required)
    - minLength 1; maxLength 64; pattern `^[A-Za-z_][A-Za-z0-9_-]*$`
  - `description` (`updatePrompt.arguments.description`; any of, optional)
    - any of: `string`, `null`
  - `required` (`updatePrompt.arguments.required`; boolean, optional) — A required argument takes no default.
  - `default` (`updatePrompt.arguments.default`; any of, optional)
    - any of: `string`, `null`
  - `match` (`updatePrompt.arguments.match`; any of, optional) — Pattern the whole value must match, diacritic-insensitive.
    - any of: `string`, `null`
  - `flags` (`updatePrompt.arguments.flags`; any of, optional) — Flags among `i`, `s` and `u`, each once, the pattern runs with; null for `i` alone.
    - any of: `string`, `null`
  - `message` (`updatePrompt.arguments.message`; any of, optional) — What a refused value is told instead of the default reason.
    - any of: `string`, `null`
  - `lenient` (`updatePrompt.arguments.lenient`; boolean, optional) — Whether a value `match` refuses falls back to the default; only an argument with one.

## Example request

```json
{
  "name": "string",
  "title": "string",
  "description": "string",
  "body": "string",
  "access": {
    "tier": {
      "id": "string"
    }
  },
  "arguments": [
    {
      "name": "string",
      "description": "string",
      "required": true,
      "default": "string",
      "match": "string",
      "flags": "str",
      "message": "string",
      "lenient": true
    }
  ]
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/prompts/<prompt>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string",
  "title": "string",
  "description": "string",
  "body": "string",
  "access": {
    "tier": {
      "id": "string"
    }
  },
  "arguments": [
    {
      "name": "string",
      "description": "string",
      "required": true,
      "default": "string",
      "match": "string",
      "flags": "str",
      "message": "string",
      "lenient": true
    }
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/prompts/<prompt>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    name: 'string',
    title: 'string',
    description: 'string',
    body: 'string',
    access: {tier: {id: 'string'}},
    arguments: [
      {
        name: 'string',
        description: 'string',
        required: true,
        default: 'string',
        match: 'string',
        flags: 'str',
        message: 'string',
        lenient: true
      }
    ]
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/prompts/<prompt>"

payload = {
    "name": "string",
    "title": "string",
    "description": "string",
    "body": "string",
    "access": { "tier": { "id": "string" } },
    "arguments": [
        {
            "name": "string",
            "description": "string",
            "required": True,
            "default": "string",
            "match": "string",
            "flags": "str",
            "message": "string",
            "lenient": True
        }
    ]
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Updates an MCP prompt's fields, text or access.

#### Example

```json
{
  "id": "string",
  "product_id": "string",
  "name": "string",
  "title": "string",
  "description": "string",
  "body": "string",
  "arguments": [
    {
      "name": "string",
      "description": "string",
      "required": true,
      "default": "string",
      "match": "string",
      "flags": "string",
      "message": "string",
      "lenient": true
    }
  ],
  "access": {
    "tier_id": "string"
  },
  "position": 0,
  "created_at": "string"
}
```

- `id` (`updatePrompt.response.200.id`; string, required)
- `product_id` (`updatePrompt.response.200.product_id`; string, required)
- `name` (`updatePrompt.response.200.name`; string, required)
- `title` (`updatePrompt.response.200.title`; any of, required)
  - any of: `string`, `null`
- `description` (`updatePrompt.response.200.description`; any of, required)
  - any of: `string`, `null`
- `body` (`updatePrompt.response.200.body`; string, required)
- `arguments` (`updatePrompt.response.200.arguments`; array<object>, required)
  - `name` (`updatePrompt.response.200.arguments.name`; string, required)
  - `description` (`updatePrompt.response.200.arguments.description`; any of, required)
    - any of: `string`, `null`
  - `required` (`updatePrompt.response.200.arguments.required`; boolean, required)
  - `default` (`updatePrompt.response.200.arguments.default`; any of, required)
    - any of: `string`, `null`
  - `match` (`updatePrompt.response.200.arguments.match`; any of, required) — Pattern the whole value must match, diacritic-insensitive.
    - any of: `string`, `null`
  - `flags` (`updatePrompt.response.200.arguments.flags`; any of, required) — Flags among `i`, `s` and `u` the pattern runs with; null for `i` alone.
    - any of: `string`, `null`
  - `message` (`updatePrompt.response.200.arguments.message`; any of, required) — What a refused value is told instead of the default reason.
    - any of: `string`, `null`
  - `lenient` (`updatePrompt.response.200.arguments.lenient`; boolean, required)
- `access` (`updatePrompt.response.200.access`; any of, required)
  - any of: `object`, `null`
- `position` (`updatePrompt.response.200.position`; number, required)
- `created_at` (`updatePrompt.response.200.created_at`; any of, required)
  - any of: `string`, `null`

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`updatePrompt.response.default.type`; string, required)
  - format `uri`
- `title` (`updatePrompt.response.default.title`; string, required)
- `status` (`updatePrompt.response.default.status`; integer, required)
- `detail` (`updatePrompt.response.default.detail`; string, required)
- `code` (`updatePrompt.response.default.code`; string, optional)
- `context` (`updatePrompt.response.default.context`; object, optional)
- `reached_core` (`updatePrompt.response.default.reached_core`; boolean, optional)
- `core_answer` (`updatePrompt.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/update-prompt/index.md
