Prompts
The Prompt Library stores reusable, versioned prompt templates with {{variable}} substitution. Use this resource for CRUD, versioning, rendering, and sharing.
Access it as client.prompts on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.
Quick start
from strongly import Strongly
client = Strongly()
# List (auto-paginates as you iterate) # filters: type, search, tags
for prompt in client.prompts.list():
print(prompt.id)
# Create
created = client.prompts.create(
name="...",
content="...",
)
print(created.id)
# Read it back
fetched = client.prompts.retrieve(created.id)
# Delete (returns None; raises on failure)
client.prompts.delete(created.id)
Methods
Core
list
list(*, type: Optional[str] = None, search: Optional[str] = None, tags: Optional[str] = None, limit: Optional[int] = None) -> SyncPaginator[Prompt]
List prompts with pagination and filters.
Args: type: Filter by type (system-prompt, user-prompt, template). search: Search by name or description. tags: Comma-separated tags to filter by. limit: Maximum number of items to return (default: all matching items).
create
create(*, name: str, content: str, type: str = "system-prompt", description: Optional[str] = None, variables: Optional[Sequence[Mapping[str, Any]]] = None, tags: Optional[Sequence[str]] = None, source: Optional[str] = None, files: Optional[Sequence[Mapping[str, Any]]] = None, github_url: Optional[str] = None, scope: Optional[Mapping[str, Any]] = None) -> Prompt
Create a new prompt. Auto-detects {{variables}} and creates version 1.
Args:
name: Prompt name (required).
content: Prompt content text (required).
type: system-prompt | user-prompt | template.
description: Prompt description.
variables: Template variables, each a plain dict with camelCase wire keys.
tags: Discoverability tags.
source: Provenance label.
files: Free-form supporting files.
github_url: Source GitHub URL.
scope: Isolation scope ({agentId?, appId?, workflowId?}).
Returns:
The created Prompt.
variables are plain dicts with camelCase wire keys you pass in the list:
created = client.prompts.create(
name="Greeting",
content="Hello {{user_name}}!",
variables=[
{"name": "user_name", "description": "Recipient name", "required": True},
],
)
retrieve
retrieve(prompt_id: <class 'str'>) -> <class 'Prompt'>
Get a prompt by ID with full content.
Args: prompt_id: The prompt ID.
update
update(prompt_id: str, *, name: Optional[str] = None, description: Optional[str] = None, content: Optional[str] = None, variables: Optional[Sequence[Mapping[str, Any]]] = None, tags: Optional[Sequence[str]] = None, change_note: Optional[str] = None) -> Dict[str, Any]
Update a prompt. Content changes auto-create a new version.
Args: prompt_id: The prompt ID. name: Updated name. description: Updated description. content: Updated content (triggers a version snapshot). variables: Updated template variables. tags: Updated tags. change_note: Note about this change.
delete
delete(prompt_id: <class 'str'>)
Delete a prompt and all its versions.
Args: prompt_id: The prompt ID.
Sharing & scope
update_scope
update_scope(prompt_id: <class 'str'>, scope: Optional[Dict[str, Any]] = None) -> Dict[str, Any]
PATCH /prompts/:id/scope - re-scope a prompt (Phase 4). Owner-only.
Other
duplicate
duplicate(prompt_id: <class 'str'>) -> Dict[str, Any]
Duplicate a prompt (creates a copy owned by the current user).
Args: prompt_id: The prompt ID to duplicate.
Returns: Dict with new promptId.
list_versions
list_versions(prompt_id: <class 'str'>) -> List[PromptVersion]
List all versions of a prompt, newest first.
Args: prompt_id: The prompt ID.
record_usage
record_usage(prompt_id: <class 'str'>)
Record a usage event for analytics.
Args: prompt_id: The prompt ID.
render
render(prompt_id: <class 'str'>, variables: Dict[str, str]) -> <class 'PromptRenderResult'>
Render a prompt with variable substitution.
Args: prompt_id: The prompt ID. variables: Dict mapping variable names to values.
Returns: PromptRenderResult with rendered content.
restore_version
restore_version(prompt_id: <class 'str'>, version_number: <class 'int'>) -> Dict[str, Any]
Restore a previous version (creates a new version with restored content).
Args: prompt_id: The prompt ID. version_number: Version number to restore.
search
search(*, q: <class 'str'>, type: Optional[str] = None, tags: Optional[str] = None, limit: Optional[int] = None) -> Dict[str, Any]
Full-text + semantic search across prompts.