API Reference
Base URL: http://localhost:5000 (pip) or http://localhost:5002 (Docker)
Endpoints
List Prompts
Returns all prompts with metadata (title, category, tags, sections count, size, modified date).Get Prompt Details
Returns full content: raw markdown, parsed sections, tags, description.Create Prompt
curl -X POST http://localhost:5002/api/prompts \
-H "Content-Type: application/json" \
-d '{
"category": "coding",
"filename": "my-prompt",
"title": "My Prompt",
"sections": [{"title": "Section 1", "prompt": "Your prompt text here"}],
"tags": ["python", "debugging"]
}'
Required fields: category, filename, title, sections
Optional fields: tags
Update Prompt
curl -X PUT http://localhost:5002/api/prompts/coding/my-prompt.md \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Title",
"sections": [{"title": "Section 1", "prompt": "Updated text"}],
"tags": ["python"]
}'
Required fields: title, sections
Optional fields: tags (omit to preserve existing tags)
Delete Prompt
curl -X DELETE http://localhost:5002/api/prompts/coding/my-prompt.md
# Also remove empty category folder
curl -X DELETE "http://localhost:5002/api/prompts/coding/my-prompt.md?delete_empty_category=true"
Download Prompt
Downloads the raw.md file.
Import Prompt
curl -X POST http://localhost:5002/api/prompts/import \
-F "file=@my-prompt.md" \
-F "category=coding"
Validation: .md extension required, max 1MB, no overwrites (409 if exists).
List Categories
List Tags
Returns all unique tags with counts.Search
curl "http://localhost:5002/api/search?q=debug"
# Case-sensitive search
curl "http://localhost:5002/api/search?q=Debug&case_sensitive=true"
Health Check
Returns: status, version, prompts directory path, timestamp.