prompts
Prompt models for Open WebUI prompt commands.
Prompts are reusable command templates that can be invoked with /command syntax.
Classes
PromptModel
Bases: BaseModel
Represents a prompt command with all stored attributes.
Prompts are reusable text templates invoked via slash commands (e.g., /help).
They support versioning, tagging, and access control via access grants.
- Code Reference routers prompts Classes PromptsClient Functions
- Code Reference models prompts Classes PromptUserResponse
Attributes
data
Additional structured data associated with the prompt.
Dict Fields
Arbitrary key-value pairs for prompt-specific data. Used by frontend for prompt configuration and rendering.
meta
Metadata for the prompt.
Dict Fields
Arbitrary key-value pairs for prompt metadata. Can include display preferences, source information, or other metadata.
version_id
ID of the active version in prompt history. Points to a history entry.
updated_at
Timestamp when the prompt was last updated (epoch time).
access_grants
access_grants: list[AccessGrantModel] = Field(default_factory=list)
List of access grants controlling who can read/write this prompt.
PromptUserResponse
Bases: PromptModel
Response model for a prompt including user details.
- Code Reference models prompts Classes PromptListResponse Attributes items
- Code Reference models prompts Classes PromptAccessResponse
Attributes
PromptAccessResponse
Bases: PromptUserResponse
Response model for a prompt with access information.
- Code Reference
PromptListResponse
Bases: BaseModel
Paginated list of prompts.
Attributes
PromptAccessListResponse
Bases: BaseModel
Paginated list of prompts with access information.
- Code Reference routers prompts Classes PromptsClient Functions get_prompt_list
Attributes
PromptForm
Bases: BaseModel
Form for creating or updating a prompt.
When updating, only changed fields need to be provided. The name field
was previously called title in earlier API versions.
- Code Reference routers prompts Classes PromptsClient Functions
Attributes
data
Additional structured data for the prompt.
Dict Fields
Arbitrary key-value pairs for prompt-specific data.
meta
Metadata for the prompt.
Dict Fields
Arbitrary key-value pairs for prompt metadata.
access_grants
Access grants to set on the prompt.
Dict Fields
id(str, optional): Unique identifier for the grantprincipal_type(str, required): 'user' or 'group'principal_id(str, required): ID of user/group, or '*' for publicpermission(str, required): 'read' or 'write'
version_id
Active version ID. Set when restoring a specific version.
commit_message
Commit message for history tracking when updating content.
PromptVersionUpdateForm
Bases: BaseModel
Form for updating the active version of a prompt.
Used to roll back to a previous version by specifying its history entry ID.
- Code Reference routers prompts Classes PromptsClient Functions set_prompt_version
PromptMetadataForm
Bases: BaseModel
Form for updating prompt metadata only.
Updates name, command, and tags without creating a history entry. Used for lightweight metadata changes that don't affect content.
- Code Reference routers prompts Classes PromptsClient Functions update_prompt_metadata
PromptAccessGrantsForm
Bases: BaseModel
Form for updating access grants on a prompt.
Used to control who can read or write the prompt.
- Code Reference routers prompts Classes PromptsClient Functions update_prompt_access
PromptHistoryModel
Bases: BaseModel
Represents a version history entry for a prompt.
Each time a prompt's content is updated, a history entry is created to track the change. History entries form a tree structure via parent_id.
- Code Reference routers prompts Classes PromptsClient Functions get_prompt_history_entry
- Code Reference models prompts Classes PromptHistoryResponse
Attributes
snapshot
Snapshot of the prompt data at this version.
Dict Fields
command(str): Command triggername(str): Display namecontent(str): Prompt contenttags(list[str], optional): Tagsdata(dict, optional): Additional datameta(dict, optional): Metadata
PromptHistoryResponse
Bases: PromptHistoryModel
Response model for prompt history with user details.
- Code Reference routers prompts Classes PromptsClient Functions get_prompt_history
Attributes
PromptDiffResponse
Bases: BaseModel
Response model for diff between two prompt versions.
- Code Reference routers prompts Classes PromptsClient Functions get_prompt_diff
Attributes
from_snapshot
Snapshot of the source version.
Dict Fields
command(str): Command triggername(str): Display namecontent(str): Prompt contenttags(list[str], optional): Tags
to_snapshot
Snapshot of the target version.
Dict Fields
command(str): Command triggername(str): Display namecontent(str): Prompt contenttags(list[str], optional): Tags