Skip to content

API Overview

The Promptly REST API lets you fetch prompts and composers directly over HTTP - no SDK required. Use it from any language or tool that can make HTTP requests.

All API requests use the following base URL:

https://api.promptlycms.com

Authenticate every request with a Bearer token in the Authorization header. Get your API key from the Promptly CMS dashboard.

Authorization: Bearer pk_live_...
  1. Get your API key

    Copy your API key from the dashboard settings.

  2. Make your first request

    Terminal window
    curl https://api.promptlycms.com/prompts/your-prompt-id \
    -H "Authorization: Bearer pk_live_..."
  3. Use the response

    The API returns JSON with the prompt content, model configuration, and template variables:

    {
    "promptId": "your-prompt-id",
    "promptName": "My Prompt",
    "version": "1.0.0",
    "systemMessage": "You are a helpful assistant.",
    "userMessage": "Help ${name} with ${task}.",
    "config": {
    "model": "claude-sonnet-4.6",
    "temperature": 0.7,
    "schema": [],
    "inputData": null,
    "inputDataRootName": null
    }
    }

In addition to individual prompts, the API supports composers — multi-prompt workflows that combine static content with prompt segments. Fetch composers via GET /composers and GET /composers/:composerId. See the Endpoints reference for full details.

The API supports CORS for all origins. Only GET and OPTIONS methods are allowed - the API is read-only.

API responses typically return in 50-80ms, making Promptly fast enough for speed-critical applications. This means you can fetch prompts at request time rather than only at startup - your users won’t notice the overhead.

REST APITypeScript SDK
LanguageAnyTypeScript/JavaScript
Type safetyManualAutomatic (with codegen)
Model resolutionManualAutomatic (AI SDK models)
Template interpolationManual string replacementBuilt-in userMessage() function
Best forNon-TypeScript apps, debugging, scriptingTypeScript apps with AI SDK
  • Endpoints - full reference for all API endpoints
  • Rate Limits - usage quotas and rate limit headers
  • Errors - error codes and troubleshooting