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
string
required
Unique command trigger for the prompt (e.g., “summarize”). Must not already be in use.
string
required
Display name for the prompt
string
required
The prompt template content. Can include variable placeholders like
{{variable}}.object
Additional data to associate with the prompt
object
Metadata for the prompt
array
Array of tag strings for categorizing the prompt
array
Array of access grant objects defining who can access this prompt
string
Message describing this initial version. Defaults to “Initial version”.
boolean
default:true
Whether to set the new version as the production version
Response
string
required
Unique identifier for the newly created prompt
string
required
Command trigger for the prompt
string
required
ID of the user who created the prompt
string
required
Display name for the prompt
string
required
The prompt template content
object
Additional data associated with the prompt
object
Metadata for the prompt
array
Array of tag strings
boolean
default:true
Whether the prompt is currently active
string
required
ID of the initial history entry created for this prompt
integer
required
Unix timestamp (epoch seconds) when prompt was created
integer
required
Unix timestamp (epoch seconds) when prompt was last updated
array
default:[]
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": []
}