Skip to main content
Retrieves a prompt either by its unique command trigger or by its ID. Returns the prompt with user information and access control details.

Endpoints

  • GET /api/prompts/command/ - Get prompt by command
  • GET /api/prompts/id/ - Get prompt by ID

Path Parameters

command
string
required
The command trigger for the prompt (only for /command/{command} endpoint)
id
string
required
The unique prompt ID (only for /id/{id} endpoint)

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 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 (current version)
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
user
object
Information about the user who created the prompt
write_access
boolean
required
Whether the authenticated user has write access to this prompt

Error Responses

  • 404 Not Found: Prompt does not exist or user does not have read access
curl -X GET "https://your-domain.com/api/prompts/command/summarize" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "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": 1709251200,
  "access_grants": [],
  "user": {
    "id": "user-123",
    "name": "John Doe",
    "email": "john@example.com"
  },
  "write_access": true
}