curl -X POST "https://your-domain.com/api/prompts/id/550e8400-e29b-41d4-a716-446655440000/update" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"command": "summarize",
"name": "Advanced Text Summarizer",
"content": "Please provide a detailed summary of the following text: {{input}}",
"tags": ["productivity", "writing", "advanced"],
"commit_message": "Enhanced summarization prompt with more detail",
"is_production": true
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"command": "summarize",
"user_id": "user-123",
"name": "Advanced Text Summarizer",
"content": "Please provide a detailed summary of the following text: {{input}}",
"data": {},
"meta": {},
"tags": ["productivity", "writing", "advanced"],
"is_active": true,
"version_id": "ver-456",
"created_at": 1709164800,
"updated_at": 1709251200,
"access_grants": []
}
Prompts
Update Prompt
Update a prompt and create a new version in history
POST
/
api
/
prompts
/
id
/
{id}
/
update
curl -X POST "https://your-domain.com/api/prompts/id/550e8400-e29b-41d4-a716-446655440000/update" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"command": "summarize",
"name": "Advanced Text Summarizer",
"content": "Please provide a detailed summary of the following text: {{input}}",
"tags": ["productivity", "writing", "advanced"],
"commit_message": "Enhanced summarization prompt with more detail",
"is_production": true
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"command": "summarize",
"user_id": "user-123",
"name": "Advanced Text Summarizer",
"content": "Please provide a detailed summary of the following text: {{input}}",
"data": {},
"meta": {},
"tags": ["productivity", "writing", "advanced"],
"is_active": true,
"version_id": "ver-456",
"created_at": 1709164800,
"updated_at": 1709251200,
"access_grants": []
}
Updates a prompt’s content and metadata. If content changes, a new version is automatically created in the prompt’s history. The user must be the prompt owner, have write access, or be an admin.
Path Parameters
The unique prompt ID to update
Request Body
Command trigger for the prompt. Can be changed if the new command is not already in use.
Display name for the prompt
The prompt template content
Additional data to associate with the prompt
Metadata for the prompt
Array of tag strings for categorizing the prompt
Array of access grant objects. If provided, access grants will be updated.
Message describing this version update (for version history)
Whether to set the new version as the production version. If false, creates a version but keeps the current production version active.
Response
Unique identifier for the prompt
Command trigger for the prompt
ID of the user who originally created the prompt
Display name for the prompt
The prompt template content
Additional data associated with the prompt
Metadata for the prompt
Array of tag strings
Whether the prompt is currently active
ID of the active history entry. Updated to new version if
is_production is true.Unix timestamp (epoch seconds) when prompt was created
Unix timestamp (epoch seconds) when prompt was last updated
Array of access grant objects
Version History
When content changes (name, command, content, tags, or access_grants), a new version is automatically created:- The version includes a snapshot of the prompt state
- A commit message can be provided to describe the changes
- The version is linked to the user making the update
- By default, the new version becomes the production version
- Set
is_production: falseto create a draft version
Error Responses
- 400 Bad Request: Command is already in use by another prompt
- 401 Unauthorized: User lacks write access to this prompt
- 404 Not Found: Prompt does not exist
curl -X POST "https://your-domain.com/api/prompts/id/550e8400-e29b-41d4-a716-446655440000/update" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"command": "summarize",
"name": "Advanced Text Summarizer",
"content": "Please provide a detailed summary of the following text: {{input}}",
"tags": ["productivity", "writing", "advanced"],
"commit_message": "Enhanced summarization prompt with more detail",
"is_production": true
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"command": "summarize",
"user_id": "user-123",
"name": "Advanced Text Summarizer",
"content": "Please provide a detailed summary of the following text: {{input}}",
"data": {},
"meta": {},
"tags": ["productivity", "writing", "advanced"],
"is_active": true,
"version_id": "ver-456",
"created_at": 1709164800,
"updated_at": 1709251200,
"access_grants": []
}
⌘I