Skip to main content
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

id
string
required
The unique prompt ID to update

Request Body

command
string
required
Command trigger for the prompt. Can be changed if the new command is not already in use.
name
string
required
Display name for the prompt
content
string
required
The prompt template content
data
object
Additional data to associate with the prompt
meta
object
Metadata for the prompt
tags
array
Array of tag strings for categorizing the prompt
access_grants
array
Array of access grant objects. If provided, access grants will be updated.
commit_message
string
Message describing this version update (for version history)
is_production
boolean
default:true
Whether to set the new version as the production version. If false, creates a version but keeps the current production version active.

Response

id
string
required
Unique identifier for the prompt
command
string
required
Command trigger for the prompt
user_id
string
required
ID of the user who originally created the prompt
name
string
required
Display name for the prompt
content
string
required
The prompt template content
data
object
Additional data associated with the prompt
meta
object
Metadata for the prompt
tags
array
Array of tag strings
is_active
boolean
required
Whether the prompt is currently active
version_id
string
ID of the active history entry. Updated to new version if is_production is true.
created_at
integer
required
Unix timestamp (epoch seconds) when prompt was created
updated_at
integer
required
Unix timestamp (epoch seconds) when prompt was last updated
access_grants
array
default:[]
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: false to 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": []
}