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

# Prompts

> Store reusable prompts inside a workspace

A prompt is reusable message text you can attach to a model or apply globally. Prompts belong
to a workspace, so pass `workspace_id` on reads and writes. Reads need `prompts:read` and
writes need `prompts:write`.

## List prompts

```
GET /api/v1/prompts?workspace_id=ws_1
```

<RequestExample>
  ```bash cURL theme={null}
  curl 'https://platform.nemu.cc/api/v1/prompts?workspace_id=ws_1' \
    -H 'Authorization: Bearer <access_token>'
  ```

  ```ts SDK theme={null}
  const prompts = await workspace.prompts.list();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": [
      {
        "id": "prm_1",
        "workspace_id": "ws_1",
        "model_id": null,
        "name": "support tone",
        "content": "You are a calm support agent.",
        "type": "SYSTEM",
        "is_global": true,
        "enabled": true,
        "position": 0,
        "environment": "PRODUCTION",
        "created_at": "2026-01-04T10:22:00.000Z",
        "updated_at": "2026-01-04T10:22:00.000Z"
      }
    ]
  }
  ```
</ResponseExample>

## Get a prompt

```
GET /api/v1/prompts/{id}?workspace_id=ws_1
```

## Create a prompt

```
POST /api/v1/prompts
```

<ParamField body="workspace_id" type="string" required>
  The workspace the prompt belongs to.
</ParamField>

<ParamField body="name" type="string" required>
  A name for the prompt.
</ParamField>

<ParamField body="content" type="string" required>
  The prompt text.
</ParamField>

<ParamField body="type" type="string">
  One of `SYSTEM`, `USER`, or `ASSISTANT`.
</ParamField>

<ParamField body="model_id" type="string | null">
  Attach the prompt to a specific model, or leave it null.
</ParamField>

<ParamField body="is_global" type="boolean">
  Apply the prompt across the workspace.
</ParamField>

<ParamField body="enabled" type="boolean">
  Whether the prompt is active.
</ParamField>

<ParamField body="position" type="integer">
  The order the prompt is applied in.
</ParamField>

<ParamField body="environment" type="string | null">
  One of `PRODUCTION`, `STAGING`, `EVALUATION`, `EXPERIMENTS`, or null.
</ParamField>

<RequestExample>
  ```ts SDK theme={null}
  const prompt = await workspace.prompts.create({
    name: "support tone",
    content: "You are a calm support agent.",
    type: "SYSTEM",
    is_global: true,
  });
  ```
</RequestExample>

## Update a prompt

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

Accepts any create field. Send `workspace_id` in the body.

## Delete a prompt

```
DELETE /api/v1/prompts/{id}
```
