---
title: "Adds an MCP prompt to a product."
---

> 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

`POST /v1/stores/{store}/products/{product}/prompts`

## Authentication

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

## Path parameters

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

## Header parameters

- `Idempotency-Key` (`createPrompt.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

_Required._

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

## Example request

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

## Code samples

### cURL

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

### TypeScript

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

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"

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

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

print(response.text)
```

## Responses

### 201

Adds an MCP prompt to a product.

#### 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` (`createPrompt.response.201.id`; string, required)
- `product_id` (`createPrompt.response.201.product_id`; string, required)
- `name` (`createPrompt.response.201.name`; string, required)
- `title` (`createPrompt.response.201.title`; any of, required)
  - any of: `string`, `null`
- `description` (`createPrompt.response.201.description`; any of, required)
  - any of: `string`, `null`
- `body` (`createPrompt.response.201.body`; string, required)
- `arguments` (`createPrompt.response.201.arguments`; array<object>, required)
  - `name` (`createPrompt.response.201.arguments.name`; string, required)
  - `description` (`createPrompt.response.201.arguments.description`; any of, required)
    - any of: `string`, `null`
  - `required` (`createPrompt.response.201.arguments.required`; boolean, required)
  - `default` (`createPrompt.response.201.arguments.default`; any of, required)
    - any of: `string`, `null`
  - `match` (`createPrompt.response.201.arguments.match`; any of, required) — Pattern the whole value must match, diacritic-insensitive.
    - any of: `string`, `null`
  - `flags` (`createPrompt.response.201.arguments.flags`; any of, required) — Flags among `i`, `s` and `u` the pattern runs with; null for `i` alone.
    - any of: `string`, `null`
  - `message` (`createPrompt.response.201.arguments.message`; any of, required) — What a refused value is told instead of the default reason.
    - any of: `string`, `null`
  - `lenient` (`createPrompt.response.201.arguments.lenient`; boolean, required)
- `access` (`createPrompt.response.201.access`; any of, required)
  - any of: `object`, `null`
- `position` (`createPrompt.response.201.position`; number, required)
- `created_at` (`createPrompt.response.201.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` (`createPrompt.response.default.type`; string, required)
  - format `uri`
- `title` (`createPrompt.response.default.title`; string, required)
- `status` (`createPrompt.response.default.status`; integer, required)
- `detail` (`createPrompt.response.default.detail`; string, required)
- `code` (`createPrompt.response.default.code`; string, optional)
- `context` (`createPrompt.response.default.context`; object, optional)
- `reached_core` (`createPrompt.response.default.reached_core`; boolean, optional)
- `core_answer` (`createPrompt.response.default.core_answer`; string, optional)


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