Paywalls
Paywalls are the core content unit in AgentWallie. Each paywall is a JSON schema document that defines layout, components, theme, and product slots. The SDK renders these natively using SwiftUI (iOS) or Jetpack Compose (Android).
Create a Paywall
POST /v1/projects/:id/paywallsRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name |
slug | string | Yes | URL-friendly identifier |
schema | object | No | Paywall JSON schema (see Schema Reference) |
Example
curl -X POST https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_your_private_key" \
-d '{
"name": "Premium Upgrade",
"slug": "premium-upgrade",
"schema": {
"version": "1.0",
"name": "premium-upgrade",
"settings": {
"presentation": "modal",
"close_button": true,
"close_button_delay_ms": 0,
"background_color": "#FFFFFF",
"scroll_enabled": true,
"safe_area_insets": true
},
"components": [
{
"type": "text",
"id": "title",
"props": { "content": "Go Premium", "text_style": "title1", "alignment": "center" }
},
{
"type": "cta_button",
"id": "cta",
"props": { "text": "Subscribe Now", "action": "purchase", "product": "primary" }
}
]
}
}'Response 201 Created
{
"id": "pw_abc123",
"name": "Premium Upgrade",
"slug": "premium-upgrade",
"status": "draft",
"version": 0,
"schema": { "..." },
"createdAt": "2025-03-15T10:00:00.000Z"
}List Paywalls
GET /v1/projects/:id/paywallsExample
curl https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls \
-H "Authorization: Bearer sk_your_private_key"Response 200 OK
[
{
"id": "pw_abc123",
"name": "Premium Upgrade",
"slug": "premium-upgrade",
"status": "draft",
"version": 0,
"createdAt": "2025-03-15T10:00:00.000Z"
},
{
"id": "pw_def456",
"name": "Trial Offer",
"slug": "trial-offer",
"status": "published",
"version": 2,
"createdAt": "2025-03-14T09:00:00.000Z"
}
]Get a Paywall
GET /v1/projects/:id/paywalls/:pidReturns the full paywall including its JSON schema.
Example
curl https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls/pw_abc123 \
-H "Authorization: Bearer sk_your_private_key"Update a Paywall
PUT /v1/projects/:id/paywalls/:pidRequest Body
All fields are optional. Only provided fields are updated.
| Field | Type | Description |
|---|---|---|
name | string | New display name |
slug | string | New slug |
schema | object | Updated paywall schema |
status | "draft" | "published" | "archived" | New status |
Example
curl -X PUT https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls/pw_abc123 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_your_private_key" \
-d '{
"name": "Premium Upgrade v2",
"schema": {
"version": "1.0",
"name": "premium-upgrade-v2",
"settings": {
"presentation": "fullscreen",
"close_button": true,
"close_button_delay_ms": 3000,
"background_color": "#1A1A2E",
"scroll_enabled": true,
"safe_area_insets": true
},
"components": [
{
"type": "text",
"id": "title",
"props": { "content": "Upgrade to Premium", "text_style": "title1", "alignment": "center" },
"style": { "color": "#FFFFFF" }
},
{
"type": "product_picker",
"id": "products",
"props": { "layout": "cards" }
},
{
"type": "cta_button",
"id": "cta",
"props": { "text": "Start Free Trial", "action": "purchase", "product": "selected" },
"style": { "background_color": "#E94560", "text_color": "#FFFFFF" }
}
]
}
}'Delete a Paywall
DELETE /v1/projects/:id/paywalls/:pidExample
curl -X DELETE https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls/pw_abc123 \
-H "Authorization: Bearer sk_your_private_key"Response 204 No Content
Publish a Paywall
POST /v1/projects/:id/paywalls/:pid/publishPublishing increments the paywall version and makes it available to SDKs. Only published paywalls appear in the compiled config.
Example
curl -X POST https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls/pw_abc123/publish \
-H "Authorization: Bearer sk_your_private_key"Response 200 OK
{
"id": "pw_abc123",
"name": "Premium Upgrade",
"status": "published",
"version": 1
}Get Version History
GET /v1/projects/:id/paywalls/:pid/versionsReturns the version history for a paywall, including schema snapshots at each version.
Example
curl https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls/pw_abc123/versions \
-H "Authorization: Bearer sk_your_private_key"Rollback to a Previous Version
POST /v1/projects/:id/paywalls/:pid/rollbackRestores a previous version's schema and auto-publishes as a new version. This is a forward operation — it creates a new version with the old schema, it does not delete any history.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
version | integer | Yes | The version number to restore |
Example
curl -X POST https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls/pw_abc123/rollback \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_your_private_key" \
-d '{"version": 2}'Response 200 OK
{
"id": "pw_abc123",
"name": "Premium Upgrade",
"status": "published",
"version": 5,
"schema": { "..." }
}The rolled-back paywall gets a new version number (e.g., rolling back from v4 to v2 creates v5 with v2's schema). The changelog records the rollback with from_version, to_version, and restored_from fields.
Compare Versions (Diff)
GET /v1/projects/:id/paywalls/:pid/versions/diff?from=1&to=3Returns a JSON diff between two version snapshots, showing path-level changes.
Query Parameters
| Param | Type | Required | Description |
|---|---|---|---|
from | integer | Yes | Source version number |
to | integer | Yes | Target version number |
Example
curl "https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls/pw_abc123/versions/diff?from=1&to=2" \
-H "Authorization: Bearer sk_your_private_key"Response 200 OK
{
"paywall_id": "pw_abc123",
"from_version": 1,
"to_version": 2,
"changes": [
{
"path": "components[0].props.content",
"from": "Unlock Premium",
"to": "Go Pro Today"
},
{
"path": "components[1].props.text",
"from": "Subscribe",
"to": "Upgrade Now"
}
]
}Preview a Paywall
POST /v1/projects/:id/paywalls/:pid/previewGenerates a preview URL for the paywall to see how it renders on device.
Example
curl -X POST https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls/pw_abc123/preview \
-H "Authorization: Bearer sk_your_private_key"Duplicate a Paywall
Duplicate an existing paywall by creating a new one with the same schema. Use GET to fetch the original schema, then POST to create a copy with a new name and slug.
Create from Template
POST /v1/projects/:id/paywalls/from-templateCreate a paywall using a pre-built template as the starting point.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
template_id | string | Yes | Template identifier (see Templates) |
name | string | Yes | Name for the new paywall |
slug | string | No | Slug (auto-generated from name if omitted) |
Example
curl -X POST https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls/from-template \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_your_private_key" \
-d '{
"template_id": "basic-subscription",
"name": "My Subscription Paywall"
}'Generate with AI
POST /v1/projects/:id/paywalls/generateGenerate a paywall schema from a natural language description.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
description | string | Yes | Natural language description of the desired paywall |
Example
curl -X POST https://agentwallie.com/api/v1/projects/PROJECT_ID/paywalls/generate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_your_private_key" \
-d '{"description": "A dark-themed fitness app paywall with a hero image, feature list, and annual/monthly pricing toggle"}'The generate endpoint uses keyword matching to select the best template and customize it based on your description. The result is a valid paywall schema that you can further modify.