REST API v1
Interactive playground + full endpoint reference. Auth, rate limits, sessions, folders, history, search — with cURL/JS/Python examples.
Try the API live
Pick an endpoint, fill in parameters, hit Send Request — see the simulated response instantly.
API Playground
Try endpoints live — base URL https://prompt-aura.ppai.web.id/api/v1
Authenticated user profile
Bearer pa_demo_a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6Press Send Request to see the response.
curl -H "Authorization: Bearer pa_demo_..." https://prompt-aura.ppai.web.id/api/v1/meScroll down for complete endpoint reference, data models, and code samples.
Base URL
https://prompt-aura.ppai.web.id/api/v1
All endpoints below are relative to this base.
Authentication
Every request requires a valid API key in the Authorization header:
Authorization: Bearer pa_xxx...xxxx
Key format
- Prefix:
pa_ - 32 lowercase hex characters
- Total: 35 characters
- Regex:
^pa_[a-f0-9]{32}$
Getting a key
- Sign in to PromptAura web app
- Go to Settings → API Keys
- Click Create Key → name it → copy (shown once)
- Store securely — cannot be retrieved again
Rate limiting
| Property | Value |
|---|---|
| Limit | 60 requests/minute |
| Window | 60 seconds (sliding) |
| Scope | Per IP (CF-Connecting-IP / x-real-ip) |
Rate limit headers
Every response includes:
| Header | Description |
|---|---|
X-RateLimit-Limit | Always 60 |
X-RateLimit-Remaining | Requests left in window |
X-RateLimit-Reset | Unix timestamp when window resets |
429 response
{
"error": "Rate limit exceeded",
"retryAfter": 45
}
Wait until X-RateLimit-Reset before retrying.
Error format
All errors follow this structure:
{
"error": "Human-readable message",
"code": "ERROR_CODE",
"details": {}
}
Common codes
| Code | HTTP | Meaning |
|---|---|---|
UNAUTHORIZED | 401 | Missing/invalid/expired key |
FORBIDDEN | 403 | Key lacks permission |
NOT_FOUND | 404 | Resource doesn’t exist |
VALIDATION_ERROR | 400 | Bad request body/query |
RATE_LIMITED | 429 | Too many requests |
INTERNAL_ERROR | 500 | Server error |
Endpoints
GET /me
Get authenticated user + API key info.
curl -H "Authorization: Bearer ***" \
https://prompt-aura.ppai.web.id/api/v1/me
Response (200):
{
"user": {
"id": "user-uuid",
"name": "Hanif",
"email": "user@example.com",
"image": "https://.../avatar.png",
"createdAt": "2026-01-15T08:00:00.000Z"
},
"apiKey": {
"keyId": "key-uuid",
"permissions": ["read"]
}
}
GET /sessions
List sessions with optional folder filter & pagination.
# All sessions
curl -H "Authorization: Bearer ***" \
"https://prompt-aura.ppai.web.id/api/v1/sessions"
# Filter by folder, paginate
curl -H "Authorization: Bearer ***" \
"https://prompt-aura.ppai.web.id/api/v1/sessions?folderId=folder-uuid&limit=20&offset=0"
Query parameters:
| Param | Type | Required | Default | Constraints |
|---|---|---|---|---|
folderId | string | No | — | Valid folder UUID |
limit | integer | No | 20 | 1–100 |
offset | integer | No | 0 | ≥ 0 |
Response (200):
{
"sessions": [
{
"id": "session-uuid-001",
"folderId": "folder-uuid-001",
"title": "Bi-Weekly Best Ads",
"rawPrompt": "Analyze the {{task}} and generate...",
"variables": { "task": "Q3 marketing campaign" },
"tags": ["ads", "marketing"],
"stepNumber": 1,
"sortOrder": 0,
"usageNote": "Use for ad performance analysis",
"isPublic": false,
"authorName": "Hanif",
"likes": 0,
"createdAt": "2026-01-24T10:00:00.000Z",
"updatedAt": "2026-05-12T14:30:00.000Z",
"syncedAt": "2026-05-12T14:30:00.000Z"
}
],
"pagination": {
"limit": 20,
"offset": 0,
"count": 12
}
}
GET /sessions/:id
Get a single session by ID.
curl -H "Authorization: Bearer ***" \
https://prompt-aura.ppai.web.id/api/v1/sessions/session-uuid-001
Response (200): Same session object as above.
404 if not found or not yours.
GET /folders
List all folders (flat list with parentId for nesting).
curl -H "Authorization: Bearer ***" \
https://prompt-aura.ppai.web.id/api/v1/folders
Response (200):
{
"folders": [
{
"id": "folder-uuid-001",
"parentId": null,
"name": "Marketing",
"createdAt": "2026-02-01T09:00:00.000Z"
},
{
"id": "folder-uuid-002",
"parentId": "folder-uuid-001",
"name": "Q3 Campaigns",
"createdAt": "2026-06-15T12:00:00.000Z"
}
]
}
GET /history
List prompt history (clipboard entries), newest first.
curl -H "Authorization: Bearer ***" \
"https://prompt-aura.ppai.web.id/api/v1/history?limit=20"
Query parameters:
| Param | Type | Required | Default | Constraints |
|---|---|---|---|---|
limit | integer | No | 20 | 1–100 |
Response (200):
{
"history": [
{
"id": "history-uuid-001",
"content": "Write a product description for...",
"timestamp": "2026-07-08T11:45:00.000Z",
"tags": ["copywriting"]
}
],
"pagination": {
"limit": 20,
"count": 15
}
}
GET /search
Search sessions by title (case-insensitive LIKE match).
curl -H "Authorization: Bearer ***" \
"https://prompt-aura.ppai.web.id/api/v1/search?q=ads&limit=20"
Query parameters:
| Param | Type | Required | Default | Constraints |
|---|---|---|---|---|
q | string | Yes | — | 1–200 chars |
limit | integer | No | 20 | 1–100 |
Response (200):
{
"results": [
{
"id": "session-uuid-001",
"folderId": "folder-uuid-001",
"title": "Bi-Weekly Best Ads",
"rawPrompt": "Analyze the {{task}} and generate...",
"variables": { "task": "Q3 marketing campaign" },
"tags": ["ads", "marketing"],
"stepNumber": 1,
"sortOrder": 0,
"usageNote": "Use for ad performance analysis",
"isPublic": false,
"authorName": "Hanif",
"likes": 0,
"createdAt": "2026-01-24T10:00:00.000Z",
"updatedAt": "2026-05-12T14:30:00.000Z",
"syncedAt": "2026-05-12T14:30:00.000Z"
}
],
"query": "ads",
"count": 3
}
400 if q missing or empty.
Data models
Session
| Field | Type | Description |
|---|---|---|
id | string | UUID |
folderId | string|null | Parent folder UUID |
title | string | Display title |
rawPrompt | string | Template with {{variables}} |
variables | object|null | Key-value map |
tags | string[]|null | Tag array |
stepNumber | integer|null | Chain step |
sortOrder | integer|null | Manual sort |
usageNote | string|null | Instructions |
isPublic | boolean | Public share status |
authorName | string|null | For public sessions |
likes | integer | Like count |
createdAt | ISO 8601 | Creation time |
updatedAt | ISO 8601 | Last update |
syncedAt | ISO 8601|null | Last sync |
Folder
| Field | Type | Description |
|---|---|---|
id | string | UUID |
parentId | string|null | Parent folder (null = root) |
name | string | Display name |
createdAt | ISO 8601 | Creation time |
History Entry
| Field | Type | Description |
|---|---|---|
id | string | UUID |
content | string | Prompt text |
timestamp | ISO 8601 | When saved |
tags | string[]|null | Tags |
User
| Field | Type | Description |
|---|---|---|
id | string | UUID |
name | string | Display name |
email | string | |
image | string|null | Avatar URL |
createdAt | ISO 8601 | Account creation |
Code examples
cURL
# List sessions
curl -H "Authorization: Bearer ***" \
https://prompt-aura.ppai.web.id/api/v1/sessions
# Get session
curl -H "Authorization: Bearer ***" \
https://prompt-aura.ppai.web.id/api/v1/sessions/session-uuid
# Search
curl -H "Authorization: Bearer ***" \
"https://prompt-aura.ppai.web.id/api/v1/search?q=marketing&limit=10"
JavaScript (fetch)
const API_BASE = 'https://prompt-aura.ppai.web.id/api/v1';
const API_KEY = 'pa_xxx...';
async function api(path, options = {}) {
const res = await fetch(`${API_BASE}${path}`, {
...options,
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
...options.headers,
},
});
if (!res.ok) throw new Error(await res.text());
return res.json();
}
// List sessions
const { sessions } = await api('/sessions?limit=50');
// Search
const { results } = await api('/search?q=coding&limit=10');
Python (requests)
import requests
API_BASE = 'https://prompt-aura.ppai.web.id/api/v1'
API_KEY = 'pa_xxx...'
headers = {
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json',
}
# List sessions
r = requests.get(f'{API_BASE}/sessions', headers=headers, params={'limit': 50})
r.raise_for_status()
sessions = r.json()['sessions']
# Search
r = requests.get(f'{API_BASE}/search', headers=headers, params={'q': 'coding', 'limit': 10})
results = r.json()['results']
Public endpoints (no auth)
| Endpoint | Description |
|---|---|
GET /public/library | List community library prompts |
GET /public/library/:slug | Get single library prompt |
GET /public/sessions/:slug | Get public session by slug |
Changelog
| Version | Date | Changes |
|---|---|---|
| v1.0.0 | 2026-07-01 | Initial release: /me, /sessions, /folders, /history, /search |