> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/open-webui/open-webui/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Prompt

> Create a new prompt with version history tracking

Creates a new prompt and automatically creates the initial version in the history. The user must have the `workspace.prompts` or `workspace.prompts_import` permission unless they are an admin.

## Request Body

<ParamField body="command" type="string" required>
  Unique command trigger for the prompt (e.g., "summarize"). Must not already be in use.
</ParamField>

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

<ParamField body="content" type="string" required>
  The prompt template content. Can include variable placeholders like `{{variable}}`.
</ParamField>

<ParamField body="data" type="object" optional>
  Additional data to associate with the prompt
</ParamField>

<ParamField body="meta" type="object" optional>
  Metadata for the prompt
</ParamField>

<ParamField body="tags" type="array" optional>
  Array of tag strings for categorizing the prompt
</ParamField>

<ParamField body="access_grants" type="array" optional>
  Array of access grant objects defining who can access this prompt
</ParamField>

<ParamField body="commit_message" type="string" optional>
  Message describing this initial version. Defaults to "Initial version".
</ParamField>

<ParamField body="is_production" type="boolean" default={true}>
  Whether to set the new version as the production version
</ParamField>

## Response

<ResponseField name="id" type="string" required>
  Unique identifier for the newly created prompt
</ResponseField>

<ResponseField name="command" type="string" required>
  Command trigger for the prompt
</ResponseField>

<ResponseField name="user_id" type="string" required>
  ID of the user who created the prompt
</ResponseField>

<ResponseField name="name" type="string" required>
  Display name for the prompt
</ResponseField>

<ResponseField name="content" type="string" required>
  The prompt template content
</ResponseField>

<ResponseField name="data" type="object" optional>
  Additional data associated with the prompt
</ResponseField>

<ResponseField name="meta" type="object" optional>
  Metadata for the prompt
</ResponseField>

<ResponseField name="tags" type="array" optional>
  Array of tag strings
</ResponseField>

<ResponseField name="is_active" type="boolean" default={true}>
  Whether the prompt is currently active
</ResponseField>

<ResponseField name="version_id" type="string" required>
  ID of the initial history entry created for this prompt
</ResponseField>

<ResponseField name="created_at" type="integer" required>
  Unix timestamp (epoch seconds) when prompt was created
</ResponseField>

<ResponseField name="updated_at" type="integer" required>
  Unix timestamp (epoch seconds) when prompt was last updated
</ResponseField>

<ResponseField name="access_grants" type="array" default={[]}>
  Array of access grant objects
</ResponseField>

## Error Responses

* **400 Bad Request**: Command is already in use by another prompt
* **401 Unauthorized**: User lacks required permissions

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://your-domain.com/api/prompts/create" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "command": "summarize",
      "name": "Text Summarizer",
      "content": "Please summarize the following text: {{input}}",
      "tags": ["productivity", "writing"],
      "commit_message": "Initial creation of summarizer prompt",
      "access_grants": []
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "command": "summarize",
    "user_id": "user-123",
    "name": "Text Summarizer",
    "content": "Please summarize the following text: {{input}}",
    "data": {},
    "meta": {},
    "tags": ["productivity", "writing"],
    "is_active": true,
    "version_id": "ver-123",
    "created_at": 1709164800,
    "updated_at": 1709164800,
    "access_grants": []
  }
  ```
</ResponseExample>
