API Reference

Integrate PromptCask into your workflows with our REST API. All endpoints require authentication via an API key.

Base URL: https://api.promptcask.com

All requests must include your API key in the x-api-key header. You can generate API keys from your workspace settings.

Prompts

Create and manage prompt templates with versioning and variable support.

GET/api/v1/prompts

Retrieve a paginated list of prompts in the current workspace. Supports filtering by tag, status, and full-text search.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
pagenumberoptionalPage number (default: 1)
limitnumberoptionalItems per page (default: 20, max: 100)
tagstringoptionalFilter by tag slug
statusstringoptionalFilter by status: draft, active, archived
qstringoptionalSearch query string

Example Request

bash
curl -X GET "https://api.promptcask.com/api/v1/prompts?workspace_id=ws_abc123&limit=10" \
  -H "x-api-key: pk_live_xxxxx"

Example Response

json
{
  "data": [
    {
      "id": "prompt_01h",
      "name": "Email Writer",
      "slug": "email-writer",
      "status": "active",
      "version": 3,
      "tags": [
        "marketing",
        "email"
      ],
      "created_at": "2026-02-10T08:00:00Z",
      "updated_at": "2026-03-01T14:30:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 10,
    "total": 42
  }
}
POST/api/v1/prompts

Create a new prompt template. The prompt will be created as a draft by default. Variables use the {{variable}} syntax in the template body.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
namestringrequiredDisplay name for the prompt
system_promptstringoptionalSystem prompt text
user_prompt_templatestringrequiredUser prompt template with {{variable}} placeholders
tagsstring[]optionalArray of tag slugs
modelstringoptionalDefault model identifier (e.g., gpt-4o)

Example Request

bash
curl -X POST "https://api.promptcask.com/api/v1/prompts" \
  -H "x-api-key: pk_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "ws_abc123",
    "name": "Bug Report Summarizer",
    "system_prompt": "You summarize bug reports into structured tickets.",
    "user_prompt_template": "Summarize this bug report: {{report}}",
    "tags": ["engineering", "bugs"]
  }'

Example Response

json
{
  "id": "prompt_02x",
  "name": "Bug Report Summarizer",
  "slug": "bug-report-summarizer",
  "status": "draft",
  "version": 1,
  "created_at": "2026-03-15T10:00:00Z"
}

Skills

Manage skill files that define agent capabilities and tool integrations.

GET/api/v1/skill-files

List all skill files for a workspace. Skill files define agent behaviors, tool schemas, and execution rules.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
pagenumberoptionalPage number (default: 1)
limitnumberoptionalItems per page (default: 20)

Example Request

bash
curl -X GET "https://api.promptcask.com/api/v1/skill-files?workspace_id=ws_abc123" \
  -H "x-api-key: pk_live_xxxxx"

Example Response

json
{
  "data": [
    {
      "id": "skill_01a",
      "name": "code-review.skill.md",
      "description": "Reviews pull requests and suggests improvements",
      "version": 2,
      "created_at": "2026-01-15T09:00:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 8
  }
}
POST/api/v1/skill-files

Create a new skill file. The content should be a valid skill definition in markdown format following the Agent Skills Standard.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
namestringrequiredSkill file name (e.g., my-skill.skill.md)
contentstringrequiredSkill file content in markdown format
descriptionstringoptionalHuman-readable description

Example Request

bash
curl -X POST "https://api.promptcask.com/api/v1/skill-files" \
  -H "x-api-key: pk_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "ws_abc123",
    "name": "deploy-checker.skill.md",
    "content": "# Deploy Checker\n\nChecks deployment readiness...",
    "description": "Validates deployment prerequisites"
  }'

Example Response

json
{
  "id": "skill_02b",
  "name": "deploy-checker.skill.md",
  "version": 1,
  "created_at": "2026-03-15T10:00:00Z"
}

Plugins

Manage plugin configurations that extend PromptCask functionality.

GET/api/v1/plugins

List all plugins installed in a workspace, including their configuration status and version information.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
statusstringoptionalFilter by status: active, inactive, error

Example Request

bash
curl -X GET "https://api.promptcask.com/api/v1/plugins?workspace_id=ws_abc123&status=active" \
  -H "x-api-key: pk_live_xxxxx"

Example Response

json
{
  "data": [
    {
      "id": "plugin_01",
      "name": "Slack Notifier",
      "type": "integration",
      "status": "active",
      "version": "1.2.0",
      "config": {
        "channel": "#prompts"
      }
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 3
  }
}
POST/api/v1/plugins

Install and configure a new plugin in the workspace.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
plugin_idstringrequiredPlugin registry identifier
configobjectoptionalPlugin-specific configuration object

Example Request

bash
curl -X POST "https://api.promptcask.com/api/v1/plugins" \
  -H "x-api-key: pk_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "ws_abc123",
    "plugin_id": "slack-notifier",
    "config": { "channel": "#prompts", "notify_on": ["publish", "approve"] }
  }'

Example Response

json
{
  "id": "plugin_02",
  "name": "Slack Notifier",
  "status": "active",
  "installed_at": "2026-03-15T10:00:00Z"
}

Snippets

Manage reusable text snippets that can be inserted into prompts.

GET/api/v1/snippets

List all snippets in a workspace. Snippets are reusable text blocks that can be referenced in prompt templates.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
pagenumberoptionalPage number (default: 1)
limitnumberoptionalItems per page (default: 20)
qstringoptionalSearch by name or content

Example Request

bash
curl -X GET "https://api.promptcask.com/api/v1/snippets?workspace_id=ws_abc123" \
  -H "x-api-key: pk_live_xxxxx"

Example Response

json
{
  "data": [
    {
      "id": "snip_01",
      "name": "Brand Voice Guidelines",
      "slug": "brand-voice",
      "content": "Always maintain a professional yet approachable tone...",
      "usage_count": 47,
      "created_at": "2026-01-20T12:00:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 15
  }
}
POST/api/v1/snippets

Create a new reusable snippet. Snippets can be referenced in prompts using the @snippet-slug syntax.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
namestringrequiredDisplay name for the snippet
contentstringrequiredSnippet text content
tagsstring[]optionalArray of tag slugs

Example Request

bash
curl -X POST "https://api.promptcask.com/api/v1/snippets" \
  -H "x-api-key: pk_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "ws_abc123",
    "name": "Safety Disclaimer",
    "content": "This AI-generated content should be reviewed by a human before use.",
    "tags": ["compliance"]
  }'

Example Response

json
{
  "id": "snip_02",
  "name": "Safety Disclaimer",
  "slug": "safety-disclaimer",
  "created_at": "2026-03-15T10:00:00Z"
}

Execution

Track and query prompt execution logs with detailed performance metrics.

GET/api/v1/logs

Retrieve execution logs for prompt runs. Includes token usage, latency, model info, and user feedback.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
prompt_idstringoptionalFilter by prompt ID
modelstringoptionalFilter by model identifier
fromstringoptionalStart date (ISO 8601)
tostringoptionalEnd date (ISO 8601)
pagenumberoptionalPage number (default: 1)
limitnumberoptionalItems per page (default: 20)

Example Request

bash
curl -X GET "https://api.promptcask.com/api/v1/logs?workspace_id=ws_abc123&prompt_id=prompt_01h&limit=5" \
  -H "x-api-key: pk_live_xxxxx"

Example Response

json
{
  "data": [
    {
      "id": "log_01",
      "prompt_id": "prompt_01h",
      "model": "gpt-4o",
      "input_tokens": 245,
      "output_tokens": 512,
      "latency_ms": 1830,
      "status": "success",
      "created_at": "2026-03-14T16:45:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 5,
    "total": 128
  }
}
POST/api/v1/logs

Record a new execution log entry. Use this when running prompts through external systems to track performance in PromptCask.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
prompt_idstringrequiredPrompt ID that was executed
modelstringrequiredModel identifier used
input_tokensnumberoptionalNumber of input tokens
output_tokensnumberoptionalNumber of output tokens
latency_msnumberoptionalExecution latency in milliseconds
statusstringrequiredExecution status: success, error, timeout
responsestringoptionalModel response text

Example Request

bash
curl -X POST "https://api.promptcask.com/api/v1/logs" \
  -H "x-api-key: pk_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "ws_abc123",
    "prompt_id": "prompt_01h",
    "model": "gpt-4o",
    "input_tokens": 200,
    "output_tokens": 450,
    "latency_ms": 1500,
    "status": "success"
  }'

Example Response

json
{
  "id": "log_02",
  "created_at": "2026-03-15T10:00:00Z"
}

Search

Semantic search across all workspace content including prompts, skills, and snippets.

Outcomes

Track and measure prompt outcomes for evaluation and optimization.

GET/api/v1/outcomes

List recorded outcomes for prompt executions. Outcomes capture whether the prompt output met the desired criteria.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
prompt_idstringoptionalFilter by prompt ID
resultstringoptionalFilter by result: pass, fail, partial
pagenumberoptionalPage number (default: 1)
limitnumberoptionalItems per page (default: 20)

Example Request

bash
curl -X GET "https://api.promptcask.com/api/v1/outcomes?workspace_id=ws_abc123&prompt_id=prompt_01h" \
  -H "x-api-key: pk_live_xxxxx"

Example Response

json
{
  "data": [
    {
      "id": "outcome_01",
      "log_id": "log_01",
      "prompt_id": "prompt_01h",
      "result": "pass",
      "score": 0.95,
      "criteria": "Follows brand voice guidelines",
      "created_at": "2026-03-14T17:00:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 64
  }
}
POST/api/v1/outcomes

Record an outcome for a prompt execution. Outcomes can be recorded manually or by automated evaluation pipelines.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
log_idstringrequiredExecution log ID to attach outcome to
resultstringrequiredOutcome result: pass, fail, partial
scorenumberoptionalNumeric score 0-1
criteriastringoptionalEvaluation criteria description
notesstringoptionalAdditional evaluator notes

Example Request

bash
curl -X POST "https://api.promptcask.com/api/v1/outcomes" \
  -H "x-api-key: pk_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "ws_abc123",
    "log_id": "log_01",
    "result": "pass",
    "score": 0.95,
    "criteria": "Output follows brand guidelines and is factually accurate"
  }'

Example Response

json
{
  "id": "outcome_02",
  "created_at": "2026-03-15T10:00:00Z"
}

Feedback

Collect user feedback on prompt outputs for continuous improvement.

POST/api/v1/feedback

Submit user feedback for a prompt execution. Feedback is used to track quality trends and prioritize prompt improvements.

Authentication

Pass your API key in the x-api-key header.

Parameters

NameTypeRequiredDescription
workspace_idstringrequiredWorkspace UUID
log_idstringrequiredExecution log ID
ratingnumberrequiredRating from 1 (poor) to 5 (excellent)
commentstringoptionalOptional text feedback
tagsstring[]optionalFeedback category tags: accurate, helpful, too_verbose, off_topic, etc.

Example Request

bash
curl -X POST "https://api.promptcask.com/api/v1/feedback" \
  -H "x-api-key: pk_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "ws_abc123",
    "log_id": "log_01",
    "rating": 4,
    "comment": "Good output but slightly too formal for our brand voice",
    "tags": ["accurate", "too_formal"]
  }'

Example Response

json
{
  "id": "fb_01",
  "created_at": "2026-03-15T10:00:00Z"
}