API Reference
The AgentWallie REST API provides full CRUD control over paywalls, campaigns, audiences, experiments, analytics, and more.
Base URL
https://agentwallie.com/apiFor local development:
http://localhost:3000Authentication
AgentWallie uses API key authentication. Each project has two keys:
| Key Type | Prefix | Usage |
|---|---|---|
| Public key | pk_ | SDK config fetches, event ingestion. Safe to embed in client apps. |
| Private key | sk_ | All management endpoints (create, update, delete). Keep server-side only. |
Using the Private Key
Pass the private key in the Authorization header:
curl https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls \
-H "Authorization: Bearer sk_your_private_key"Using the Public Key
Public endpoints use the key as a URL parameter:
# SDK config fetch
GET /v1/config/pk_your_public_key
# Event ingestion
POST /v1/events/pk_your_public_keyRequest / Response Format
All request and response bodies use JSON. Set Content-Type: application/json for POST/PUT requests.
Success Responses
{
"id": "abc123",
"name": "My Paywall",
"status": "draft",
"createdAt": "2025-01-15T10:30:00.000Z"
}List endpoints return arrays:
[
{ "id": "abc123", "name": "Paywall A" },
{ "id": "def456", "name": "Paywall B" }
]Error Responses
Errors return an appropriate HTTP status code with a JSON body:
{
"error": "Validation error",
"details": [
{ "path": ["name"], "message": "Required" }
]
}| Status Code | Meaning |
|---|---|
400 | Bad request -- invalid input or validation error |
401 | Unauthorized -- missing or invalid API key |
404 | Not found -- resource does not exist |
409 | Conflict -- resource already exists (e.g., duplicate experiment) |
429 | Rate limit exceeded |
500 | Internal server error |
Rate Limits
| Endpoint Group | Limit | Window |
|---|---|---|
Management API (all /v1/projects/...) | 1,000 requests | 15 minutes |
Config fetch (/v1/config/:key) | 60 requests | 1 minute |
Event ingestion (/v1/events/:key) | 120 requests | 1 minute |
Rate limit headers are included in responses:
RateLimit-Limit: 1000
RateLimit-Remaining: 998
RateLimit-Reset: 1705320600⚠️
Rate limits are per IP address. If you hit limits during development, wait for the window to reset.
Endpoint Overview
| Resource | Endpoints | Auth |
|---|---|---|
| Projects | Create, get, rotate keys | Private key |
| Paywalls | CRUD, publish, preview, templates, AI generate | Private key |
| Campaigns | CRUD + placements + audiences | Private key |
| Experiments | Create, get with metrics, promote, reset | Private key |
| Analytics | Overview, funnel, revenue, cohorts, query | Private key |
| Events | Ingest SDK events | Public key |
| Config | Compiled SDK config | Public key |
| Receipts & Subscriptions | Receipt validation, subscription status | Public key |
| Webhooks | CRUD + HMAC verification | Private key |
| Agent Features | Validate, dry-run, changelog, diff, migration | Private key |
Authentication details, including API key types and usage, are documented above on this page.