API Reference
Overview

API Reference

The AgentWallie REST API provides full CRUD control over paywalls, campaigns, audiences, experiments, analytics, and more.

Base URL

https://agentwallie.com/api

For local development:

http://localhost:3000

Authentication

AgentWallie uses API key authentication. Each project has two keys:

Key TypePrefixUsage
Public keypk_SDK config fetches, event ingestion. Safe to embed in client apps.
Private keysk_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_key

Request / 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 CodeMeaning
400Bad request -- invalid input or validation error
401Unauthorized -- missing or invalid API key
404Not found -- resource does not exist
409Conflict -- resource already exists (e.g., duplicate experiment)
429Rate limit exceeded
500Internal server error

Rate Limits

Endpoint GroupLimitWindow
Management API (all /v1/projects/...)1,000 requests15 minutes
Config fetch (/v1/config/:key)60 requests1 minute
Event ingestion (/v1/events/:key)120 requests1 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

ResourceEndpointsAuth
ProjectsCreate, get, rotate keysPrivate key
PaywallsCRUD, publish, preview, templates, AI generatePrivate key
CampaignsCRUD + placements + audiencesPrivate key
ExperimentsCreate, get with metrics, promote, resetPrivate key
AnalyticsOverview, funnel, revenue, cohorts, queryPrivate key
EventsIngest SDK eventsPublic key
ConfigCompiled SDK configPublic key
Receipts & SubscriptionsReceipt validation, subscription statusPublic key
WebhooksCRUD + HMAC verificationPrivate key
Agent FeaturesValidate, dry-run, changelog, diff, migrationPrivate key

Authentication details, including API key types and usage, are documented above on this page.