Skip to content

API Overview

The Promptly REST API lets you fetch prompts 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.5",
    "temperature": 0.7,
    "schema": [],
    "inputData": null,
    "inputDataRootName": null
    }
    }

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

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