API Overview
Integrate PromptReports into your applications with our comprehensive REST API. Programmatically manage prompts, run evaluations, and automate workflows.
API Overview#
The PromptReports API provides programmatic access to all platform features. Use it to integrate prompt management into your existing tools, automate testing pipelines, or build custom applications on top of our infrastructure.
Prompts API
Create, update, version, and execute prompts programmatically.
Reports API
Generate reports, manage templates, and export content.
Webhooks API
Configure and manage webhook subscriptions.
Authentication
API key management and secure authentication.
Authentication#
All API requests require authentication using an API key. Include your key in the Authorization header:
curl -X GET "https://api.promptreports.ai/v1/prompts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Keep Your API Key Secure
Generate API keys from your account settings. You can create multiple keys with different permissions for different use cases.
Base URL#
Production: https://api.promptreports.ai/v1
Development: https://api-staging.promptreports.ai/v1All endpoints are versioned. The current stable version is v1. We follow semantic versioning and will communicate breaking changes well in advance.
Available Endpoints#
| Resource | Endpoints | Description |
|---|---|---|
| Prompts | GET, POST, PATCH, DELETE /prompts | Manage prompts and drafts |
| Versions | GET, POST /prompts/:id/versions | Version control operations |
| Evaluations | GET, POST /evaluations | Run and retrieve evaluations |
| Datasets | GET, POST, PATCH, DELETE /datasets | Manage test datasets |
| Folders | GET, POST, PATCH, DELETE /folders | Organize prompts |
| Reports | GET, POST /reports | Generate and retrieve reports |
| Templates | GET /templates | Browse report templates |
| Webhooks | GET, POST, PATCH, DELETE /webhooks | Manage webhooks |
curl -X POST "https://api.promptreports.ai/v1/prompts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"folderId": "fld_abc123",
"name": "Customer Support Response",
"content": "You are a helpful customer support agent for {{company}}. Respond to: {{question}}"
}'curl -X POST "https://api.promptreports.ai/v1/prompts/prm_xyz789/execute" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"variables": {
"company": "Acme Corp",
"question": "What are your business hours?"
},
"model": "gpt-4",
"temperature": 0.7
}'Rate Limits#
API requests are rate-limited to ensure fair usage and platform stability:
| Plan | Requests/Minute | Requests/Day |
|---|---|---|
| Free | 60 | 1,000 |
| Pro | 300 | 10,000 |
| Enterprise | 1,000 | 100,000 |
Rate limit headers are included in every response:
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 299
X-RateLimit-Reset: 1673456789Error Handling#
The API uses conventional HTTP status codes and returns errors in a consistent format:
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid prompt content",
"details": {
"field": "content",
"issue": "Content cannot be empty"
}
}
}| Status | Meaning | Common Causes |
|---|---|---|
| 400 | Bad Request | Invalid parameters, validation errors |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient permissions |
| 404 | Not Found | Resource does not exist |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Internal error (contact support) |
Handling Errors
success field in responses. Implement exponential backoff for 429 and 5xx errors, and log error details for debugging.