curl -X POST "https://your-domain.com/api/prompts/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"command": "summarize",
"name": "Text Summarizer",
"content": "Please summarize the following text: {{input}}",
"tags": ["productivity", "writing"],
"commit_message": "Initial creation of summarizer prompt",
"access_grants": []
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"command": "summarize",
"user_id": "user-123",
"name": "Text Summarizer",
"content": "Please summarize the following text: {{input}}",
"data": {},
"meta": {},
"tags": ["productivity", "writing"],
"is_active": true,
"version_id": "ver-123",
"created_at": 1709164800,
"updated_at": 1709164800,
"access_grants": []
}
Prompts
Create Prompt
Create a new prompt with version history tracking
POST
/
api
/
prompts
/
create
curl -X POST "https://your-domain.com/api/prompts/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"command": "summarize",
"name": "Text Summarizer",
"content": "Please summarize the following text: {{input}}",
"tags": ["productivity", "writing"],
"commit_message": "Initial creation of summarizer prompt",
"access_grants": []
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"command": "summarize",
"user_id": "user-123",
"name": "Text Summarizer",
"content": "Please summarize the following text: {{input}}",
"data": {},
"meta": {},
"tags": ["productivity", "writing"],
"is_active": true,
"version_id": "ver-123",
"created_at": 1709164800,
"updated_at": 1709164800,
"access_grants": []
}
Creates a new prompt and automatically creates the initial version in the history. The user must have the
workspace.prompts or workspace.prompts_import permission unless they are an admin.
Request Body
Unique command trigger for the prompt (e.g., “summarize”). Must not already be in use.
Display name for the prompt
The prompt template content. Can include variable placeholders like
{{variable}}.Additional data to associate with the prompt
Metadata for the prompt
Array of tag strings for categorizing the prompt
Array of access grant objects defining who can access this prompt
Message describing this initial version. Defaults to “Initial version”.
Whether to set the new version as the production version
Response
Unique identifier for the newly created prompt
Command trigger for the prompt
ID of the user who 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 initial history entry created for this prompt
Unix timestamp (epoch seconds) when prompt was created
Unix timestamp (epoch seconds) when prompt was last updated
Array of access grant objects
Error Responses
- 400 Bad Request: Command is already in use by another prompt
- 401 Unauthorized: User lacks required permissions
curl -X POST "https://your-domain.com/api/prompts/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"command": "summarize",
"name": "Text Summarizer",
"content": "Please summarize the following text: {{input}}",
"tags": ["productivity", "writing"],
"commit_message": "Initial creation of summarizer prompt",
"access_grants": []
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"command": "summarize",
"user_id": "user-123",
"name": "Text Summarizer",
"content": "Please summarize the following text: {{input}}",
"data": {},
"meta": {},
"tags": ["productivity", "writing"],
"is_active": true,
"version_id": "ver-123",
"created_at": 1709164800,
"updated_at": 1709164800,
"access_grants": []
}
⌘I