Skip to main content
Prompts in Open WebUI allow you to create, manage, and share reusable prompt templates that can be invoked using slash commands in conversations. The system includes version control, access management, and collaborative features.

Overview

Prompts provide:
  • Slash command invocation (e.g., /translate)
  • Version history and rollback capabilities
  • Access control and sharing permissions
  • Tag-based organization
  • Metadata tracking for each version
  • Search and filtering capabilities
Prompts are stored in the database with full version history. Each update creates a new version that can be activated, compared, or restored.

Creating Prompts

Through the Web Interface

1

Navigate to Workspace

Go to Workspace → Prompts in the Open WebUI interface
2

Create New Prompt

Click Create New Prompt and configure:
  • Name: Display name for the prompt
  • Command: Slash command (e.g., translate for /translate)
  • Content: The actual prompt template with variables
  • Tags: Optional tags for organization
3

Add Template Variables

Use double curly braces for variables in your prompt:
Translate the following text to {{language}}:

{{text}}

Provide only the translation without explanations.
4

Save and Activate

Save the prompt to create the initial version. It’s automatically activated as the production version.

Via API

Create prompts programmatically:
import requests

url = "http://localhost:8080/api/prompts/create"
payload = {
    "command": "summarize",
    "name": "Text Summarizer",
    "content": "Summarize the following text in {{num_sentences}} sentences:\n\n{{text}}",
    "tags": ["writing", "productivity"],
    "commit_message": "Initial version",
    "access_grants": []
}

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

Using Prompts in Conversations

Prompts can be invoked using slash commands:
  1. Type the slash command: Start typing / in the chat input to see available prompts
  2. Select your prompt: Choose from the autocomplete list or type the full command
  3. Fill variables: The UI will prompt you to fill in any template variables
  4. Send: The expanded prompt is sent to the model
Only active prompts appear in the slash command autocomplete. Use the toggle feature to enable/disable prompts.

Version Control

Every prompt update creates a new version in the history:

View Version History

Retrieve all versions of a prompt:
import requests

response = requests.get(
    f"http://localhost:8080/api/prompts/id/{prompt_id}/history",
    params={"page": 0}  # Paginated, 20 versions per page
)

history = response.json()
for version in history:
    print(f"Version {version['id']}: {version['commit_message']}")

Compare Versions

Get a diff between two versions:
import requests

response = requests.get(
    f"http://localhost:8080/api/prompts/id/{prompt_id}/history/diff",
    params={
        "from_id": version_1_id,
        "to_id": version_2_id
    }
)

diff = response.json()

Restore Previous Version

Set an older version as the active production version:
import requests

url = f"http://localhost:8080/api/prompts/id/{prompt_id}/update/version"
payload = {"version_id": previous_version_id}

response = requests.post(url, json=payload)
Restoring a version updates the prompt’s content to match that version’s snapshot. This creates a new history entry with the restored content.

Delete Version

Remove a version from history (cannot delete the active production version):
import requests

response = requests.delete(
    f"http://localhost:8080/api/prompts/id/{prompt_id}/history/{history_id}"
)

Managing Prompts

List All Prompts

Get paginated list with search and filtering:
import requests

response = requests.get(
    "http://localhost:8080/api/prompts/list",
    params={
        "query": "translate",     # Search term
        "tag": "productivity",    # Filter by tag
        "view_option": "created", # "created" or "shared"
        "order_by": "updated_at", # Sort field
        "direction": "desc",      # Sort direction
        "page": 1                 # Page number
    }
)

result = response.json()
prompts = result["items"]
total = result["total"]

Get Prompt by Command

import requests

response = requests.get(
    f"http://localhost:8080/api/prompts/command/translate"
)

prompt = response.json()
print(f"Content: {prompt['content']}")
print(f"Write access: {prompt['write_access']}")

Update Prompt

Updating creates a new version in the history:
import requests

url = f"http://localhost:8080/api/prompts/id/{prompt_id}/update"
payload = {
    "command": "translate",
    "name": "Advanced Translator",
    "content": "Updated prompt content with {{variables}}",
    "tags": ["translation", "language"],
    "commit_message": "Added support for multiple languages",
    "is_production": True  # Set this version as active
}

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

Update Metadata Only

Update name, command, or tags without creating a version:
import requests

url = f"http://localhost:8080/api/prompts/id/{prompt_id}/update/meta"
payload = {
    "name": "Quick Translator",
    "command": "qtranslate",
    "tags": ["translation"]
}

response = requests.post(url, json=payload)
Metadata updates don’t create version history entries. Use this for minor changes like renaming or reorganizing.

Toggle Active Status

Enable or disable a prompt:
import requests

response = requests.post(
    f"http://localhost:8080/api/prompts/id/{prompt_id}/toggle"
)

updated_prompt = response.json()
print(f"Active: {updated_prompt['is_active']}")

Delete Prompt

Permanently remove a prompt and all its version history:
import requests

response = requests.delete(
    f"http://localhost:8080/api/prompts/id/{prompt_id}/delete"
)

Access Control and Sharing

Set Access Permissions

Prompts support granular access control:
import requests

url = f"http://localhost:8080/api/prompts/id/{prompt_id}/access/update"
payload = {
    "access_grants": [
        {
            "access_type": "user",
            "access_id": user_id,
            "permission": "read"  # or "write"
        },
        {
            "access_type": "group",
            "access_id": group_id,
            "permission": "write"
        }
    ]
}

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

Permission Types

  • read: View and use the prompt (slash command access)
  • write: Edit the prompt, manage versions, and modify access

Access Grant Types

  • user: Grant access to specific users
  • group: Grant access to all members of a group
Only the prompt creator, users with write access, and admin users can modify access permissions.

Tags and Organization

Get All Tags

Retrieve all unique tags across prompts:
import requests

response = requests.get("http://localhost:8080/api/prompts/tags")
tags = response.json()

for tag in tags:
    print(tag)

Filter by Tags

Find prompts with specific tags:
import requests

response = requests.get(
    "http://localhost:8080/api/prompts/list",
    params={"tag": "productivity"}
)

prompts = response.json()["items"]

Prompt Examples

payload = {
    "command": "review",
    "name": "Code Reviewer",
    "content": """Review the following {{language}} code for:
- Code quality and best practices
- Potential bugs and edge cases
- Performance optimizations
- Security vulnerabilities

Code:
```{{language}}
{{code}}
Provide detailed feedback with specific suggestions.""", “tags”: [“development”, “code-quality”], “commit_message”: “Initial code review prompt” }
</Accordion>

<Accordion title="Email Generator">
```python
payload = {
    "command": "email",
    "name": "Professional Email",
    "content": """Write a professional email with the following details:

Tone: {{tone}}
Recipient: {{recipient}}
Purpose: {{purpose}}
Key Points:
{{key_points}}

Format the email with appropriate greeting, body, and closing.""",
    "tags": ["writing", "communication"],
    "commit_message": "Email template prompt"
}
payload = {
    "command": "meeting-summary",
    "name": "Meeting Notes Summary",
    "content": """Summarize the following meeting notes:

{{notes}}

Provide:
1. Key decisions made
2. Action items with owners
3. Open questions or concerns
4. Next steps

Format as a clear, structured summary.""",
    "tags": ["productivity", "meetings"],
    "commit_message": "Meeting summary template"
}

Best Practices

  1. Use Clear Commands: Choose short, memorable slash commands
  2. Document Variables: Use descriptive variable names in {{brackets}}
  3. Version Messages: Write clear commit messages for each update
  4. Test Before Sharing: Verify prompts work as expected before granting access
  5. Organize with Tags: Use consistent tags for easy discovery
  6. Control Access: Only share prompts with appropriate users/groups
  7. Keep Production Stable: Test changes in non-production versions first

Troubleshooting

Command Already Exists

Each command must be unique across all prompts:
{
  "error": "Command '/translate' is already in use by another prompt"
}
Solution: Choose a different command or update the existing prompt.

Access Denied

Users need appropriate permissions to view or edit prompts:
{
  "error": "ACCESS_PROHIBITED"
}
Solution: Request access from the prompt owner or an admin.

Version Not Found

Attempting to restore or view a deleted version:
{
  "error": "NOT_FOUND"
}
Solution: Check version history to find valid version IDs.

Next Steps

  • Learn about Functions for custom Python logic
  • Explore Skills for reusable capabilities
  • Configure Tools for extended functionality