API Reference

Complete reference for the Enprompta REST API. Build powerful prompt management into your applications.

Overview

Base URL

https://enprompta.com/api/v1
HTTPS Only

All API requests must use HTTPS

JSON Format

Request and response bodies are JSON

Request Headers

Required Headers
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

Authentication

Enprompta uses API keys to authenticate requests. The API supports both API keys and OAuth2 client credentials for machine-to-machine authentication — manage both from your dashboard under API Keys (OAuth clients live in the OAuth Clients section there).

REST API requires a paid plan

Creating API keys and OAuth clients is free — but using the REST API (prompts, executions, teams) requires an active Pro or Enterprise subscription. Every member of a paid workspace is covered: editor seats read/write, free viewer seats read-only. Recording observability traces via the SDK works on any plan (5,000/month on Free).

View pricing plans

Keep your API keys secure

Never expose API keys in client-side code. Use environment variables and server-side requests.

Getting Your API Key

  1. Log in to your Enprompta Dashboard
  2. Navigate to Settings → API Keys
  3. Click Generate New Key
  4. Copy and securely store your key

Using Your API Key

cURL Example
curl https://enprompta.com/api/v1/prompts \
  -H "Authorization: Bearer ep_your_api_key" \
  -H "Content-Type: application/json"
TypeScript Example
import { Enprompta } from '@enprompta/sdk'

const client = new Enprompta({
  apiKey: process.env.ENPROMPTA_API_KEY
})

// All requests are now authenticated
const prompts = await client.prompts.list()

Ready to integrate with the API?

Upgrade to Pro to create API keys and start building. Pro includes a 14-day free trial.

Rate Limits

Rate limits are applied per API key. Limits reset at the top of each minute. Note: keys are free to create; using the REST API requires a Pro or Enterprise plan.

PlanAPI AccessRequests/MinuteRequests/Day
FreeTrace ingestion only
ProFull Access60 (standard key) · 300 (premium key)10,000 · 100,000
EnterpriseFull AccessCustom (up to 1,000+)Custom

Note: Free accounts get unlimited prompt enhancements through the browser extension and web dashboard, plus 5,000 observability traces/month via SDK ingestion. Upgrade to Pro for full programmatic API access.

Rate Limit Headers

Every API response includes rate limit information in the headers:

Response Headers
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1705492800

Handling Rate Limits

When you exceed your rate limit, the API returns a 429 Too Many Requests status. Our SDKs automatically handle retries with exponential backoff.

Prompts

Create, manage, and execute prompts. Prompts support variables using {{variable}} syntax.

Templates

Browse and use pre-built prompt templates from the community.

Teams

Manage team access and collaboration.

Webhooks

Receive real-time notifications when events occur.

Available Events

EventDescription
prompt.executedPrompt execution completed
team.member_addedNew team member joined
team.member_removedTeam member removed

Webhook Payload

Example Payload
{
  "id": "evt_abc123",
  "event": "prompt.executed",
  "created_at": "2024-01-17T10:15:00Z",
  "api_version": "2024-01-01",
  "data": {
    "execution_id": "exe_xyz789",
    "prompt_id": "pmt_abc123",
    "status": "completed",
    "tokens_used": 568,
    "cost": 0.0284
  }
}

Signature Verification

Verify webhook authenticity using HMAC-SHA256:

Node.js Verification
const crypto = require('crypto')

function verifySignature(payload, signature, secret) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(JSON.stringify(payload))
    .digest('hex')

  return `sha256=${expected}` === signature
}

// In your webhook handler
app.post('/webhook', (req, res) => {
  const signature = req.headers['x-enprompta-signature']

  if (!verifySignature(req.body, signature, WEBHOOK_SECRET)) {
    return res.status(401).send('Invalid signature')
  }

  // Process webhook
  const { event, data } = req.body
  console.log(`Received ${event}:`, data)

  res.status(200).send('OK')
})

Error Handling

The API uses standard HTTP status codes and returns detailed error information.

Error Response Format

Error Response
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request parameters",
    "details": [
      {
        "field": "temperature",
        "message": "Must be between 0 and 2"
      }
    ]
  }
}

HTTP Status Codes

CodeStatusDescription
200OKRequest successful
201CreatedResource created successfully
400Bad RequestInvalid request parameters
401UnauthorizedInvalid or missing API key
403ForbiddenInsufficient permissions
404Not FoundResource not found
402Payment RequiredInsufficient tokens
429Too Many RequestsRate limit exceeded
500Internal ErrorServer error

Official SDKs

Use our official SDKs for the best developer experience with automatic retries, type safety, and convenient helpers.

Try the API Workbench

Test endpoints interactively with your account. See real responses and debug your integration.

Open Workbench

Ready to get started?

Create your free account and start building with the Enprompta API in minutes.

Additional Resources

API Reference - Enprompta