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.
Base URL
Section titled “Base URL”All API requests use the following base URL:
https://api.promptlycms.comAuthentication
Section titled “Authentication”Authenticate every request with a Bearer token in the Authorization header. Get your API key from the Promptly CMS dashboard.
Authorization: Bearer pk_live_...Quick start
Section titled “Quick start”-
Get your API key
Copy your API key from the dashboard settings.
-
Make your first request
Terminal window curl https://api.promptlycms.com/prompts/your-prompt-id \-H "Authorization: Bearer pk_live_..."const response = await fetch('https://api.promptlycms.com/prompts/your-prompt-id',{headers: {Authorization: 'Bearer pk_live_...',},},);const prompt = await response.json(); -
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 API vs SDK
Section titled “REST API vs SDK”| REST API | TypeScript SDK | |
|---|---|---|
| Language | Any | TypeScript/JavaScript |
| Type safety | Manual | Automatic (with codegen) |
| Model resolution | Manual | Automatic (AI SDK models) |
| Template interpolation | Manual string replacement | Built-in userMessage() function |
| Best for | Non-TypeScript apps, debugging, scripting | TypeScript apps with AI SDK |
Next steps
Section titled “Next steps”- Endpoints - full reference for all API endpoints
- Rate Limits - usage quotas and rate limit headers
- Errors - error codes and troubleshooting