Sites API
Create and manage site projects, pages, and components.
Endpoints
/api/v1/appBuilder/listProjectsList all app builder projects. Returns array with id, name, description, linkedBaseId, page count, component count.
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listProjects \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{}'/api/v1/appBuilder/getProjectGet a project with its pages, components, linkedBase, and triggers
Parameters
id | stringrequired | Project ID from listProjects |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getProject \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/getAccessOverviewAggregated access-control snapshot for the central Access Control page.
Parameters
projectId | stringrequired | Project ID from listProjects |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getAccessOverview \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/createProjectCreate a new app builder project
Parameters
name | stringrequired | Project name |
description | string | Optional project description |
color | string | Hex color code (default: #3B82F6) |
brandKit | any | Brand kit (colors/typography/tokens) to seed the project design system |
projectType | string | Project type: web or mobile app |
bundleIdentifier | string | Mobile app bundle identifier (e.g. com.example.myapp) |
appDisplayName | string | Mobile app display name for App Store / Play Store |
isDevSite | boolean | Partner dev site: visitor-locked test site that does not consume plan quota (partners only) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createProject \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "example",
"description": "example",
"color": "example"
}'/api/v1/appBuilder/updateProjectUpdate project settings including branding, dependencies, marketplace, and mobile config
Parameters
id | stringrequired | Project ID from listProjects |
name | string | New project name |
description | string | New description |
color | string | New hex color code |
logo | string | URL or path to logo image (recommended: 200x50px PNG or SVG) |
favicon | string | URL or path to favicon image (recommended: 32x32px PNG or ICO) |
showSerenitesBranding | boolean | Show "Powered by Serenities AI" branding on published app |
dependencies | object | NPM packages to bundle. Example: {"framer-motion": "^10.0.0", "chart.js": "^4.4.0"}. Packages are installed via Bun and bundled by Vite for production. Tailwind CSS is included by default. |
aiKnowledge | string | AI project knowledge - persistent instructions for AI including project goals, coding style, and constraints |
brandKit | object | Brand kit - design tokens and identity (colors, typography, logo, voice, style) the AI applies when generating UI |
marketplaceEnabled | boolean | Enable marketplace listing for this app |
marketplaceThumbnail | string | Thumbnail image URL or path for marketplace listing (recommended: 400x300px) |
marketplaceCover | string | Cover/banner image URL or path for marketplace detail page (recommended: 1200x400px) |
marketplaceDescription | string | Extended description for marketplace listing |
appDisplayName | string | Mobile app display name for App Store / Play Store |
bundleIdentifier | string | Mobile app bundle identifier (e.g. com.example.myapp) |
appVersion | string | Mobile app version (e.g. 1.0.0) |
buildNumber | integer | Mobile app build number |
appIcon | string | URL to app icon image (1024x1024 PNG) |
splashScreen | string | URL to splash screen image (1284x2778 PNG) |
orientation | string | Mobile app orientation lock |
mobilePermissions | array | Mobile permissions: camera, location, notifications, media-library, contacts, biometrics, file-system |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateProject \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"name": "example",
"description": "example"
}'/api/v1/appBuilder/setPageActiveActivate or deactivate a page. Slot rule: exactly ONE active page per URL path — activating a page automatically deactivates any sibling page holding the same path (e.g. switching which "/" home page variant is live). Params: projectId, pageId, active (boolean).
Parameters
projectId | stringrequired | Project ID from listProjects |
pageId | stringrequired | |
active | booleanrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/setPageActive \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"pageId": "example",
"active": true
}'/api/v1/appBuilder/updateProjectAuthUpdate project authentication settings
Parameters
id | stringrequired | Project ID |
authEnabled | boolean | Enable authentication for this app |
authAllowSignup | boolean | Allow new users to sign up |
authRequireEmail | boolean | Require email verification |
authAllowSocial | boolean | Allow social login (Google, GitHub) |
authPaths | object | Custom auth paths object. Keys: login, signup, forgotPassword, resetPassword, verifyEmail, afterLogin, afterLogout, accessDenied, or any custom paths. Values: the URL path (e.g., "/signin", "/register") |
authCustomFields | array | Custom signup form fields. MERGED by field name into the existing list (upsert): pass only the fields you want to add or change — omitted fields are preserved, not dropped. Pass null to clear ALL fields. To delete specific fields, use removeCustomFields. |
removeCustomFields | array | Field names to remove from authCustomFields. Does not delete values already stored on user profiles, only stops the field being declared. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateProjectAuth \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"authEnabled": true,
"authAllowSignup": true
}'/api/v1/appBuilder/bundleDepsBundle npm dependencies for a project. Call this after adding/changing dependencies to ensure they are bundled and ready for preview.
Parameters
id | stringrequired | Project ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/bundleDeps \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/updateSubdomainUpdate the published subdomain for an app
Parameters
id | stringrequired | Project ID |
subdomain | stringrequired | New subdomain (without .serenitiesai.app) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateSubdomain \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"subdomain": "example"
}'/api/v1/appBuilder/listEnvVarsList environment variables for a project
Parameters
projectId | stringrequired | Project ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listEnvVars \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/createEnvVarCreate a new environment variable
Parameters
projectId | stringrequired | Project ID |
name | stringrequired | Variable name (e.g., OPENAI_API_KEY) |
value | stringrequired | Variable value |
description | string | Optional description |
isSecret | boolean | If true, value is masked in UI |
installScopeId | string | Scope this variable to an installed plugin (listingId) — the plugin sees it, nothing else does. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createEnvVar \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example",
"value": "example"
}'/api/v1/appBuilder/updateEnvVarUpdate an environment variable
Parameters
id | stringrequired | Environment variable ID |
value | string | New value (only if changing) |
description | string | New description |
isSecret | boolean | Update secret flag |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateEnvVar \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"value": "example",
"description": "example"
}'/api/v1/appBuilder/deleteEnvVarDelete an environment variable
Parameters
id | stringrequired | Environment variable ID to delete |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteEnvVar \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/updateCustomDomainUpdate custom domain settings
Parameters
id | stringrequired | Project ID |
customDomain | string | Custom domain (e.g., myapp.com) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateCustomDomain \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"customDomain": "example"
}'/api/v1/appBuilder/getAppUsersGet users who signed up to this published app
Parameters
projectId | stringrequired | Project ID |
limit | number | |
offset | number |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getAppUsers \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"limit": 0,
"offset": 0
}'/api/v1/appBuilder/deleteAppUserDelete a user from this published app
Parameters
projectId | stringrequired | Project ID |
userId | stringrequired | App user ID to delete |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteAppUser \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"userId": "example"
}'/api/v1/appBuilder/getEntitlementsList an app user's entitlements with live status — what paid access they hold right now
Parameters
projectId | stringrequired | Project ID |
appUserId | stringrequired | App user ID (from getAppUsers) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getEntitlements \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"appUserId": "example"
}'/api/v1/appBuilder/grantEntitlementGrant (or re-activate) paid access to an app user — e.g. a free month, a comp, or after an offline payment
Parameters
projectId | stringrequired | Project ID |
appUserId | stringrequired | App user ID |
key | stringrequired | Entitlement key, e.g. "member" |
expiresAt | string | ISO date when access ends; omit for lifetime |
graceUntil | string | ISO date grace period ends (access continues past expiry until then) |
source | object | Audit context, e.g. { reason: "support comp" } |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/grantEntitlement \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"appUserId": "example",
"key": "example"
}'/api/v1/appBuilder/extendEntitlementExtend an existing entitlement's expiry (renewal)
Parameters
projectId | stringrequired | Project ID |
appUserId | stringrequired | App user ID |
key | stringrequired | Entitlement key |
expiresAt | stringrequired | New ISO expiry date (required — use grantEntitlement for lifetime) |
graceUntil | string | ISO date grace period ends |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/extendEntitlement \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"appUserId": "example",
"key": "example"
}'/api/v1/appBuilder/suspendEntitlementSuspend an entitlement (e.g. missed installment) — access ends when any grace runs out
Parameters
projectId | stringrequired | Project ID |
appUserId | stringrequired | App user ID |
key | stringrequired | Entitlement key |
graceUntil | string | ISO date until which access continues despite suspension (grace) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/suspendEntitlement \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"appUserId": "example",
"key": "example"
}'/api/v1/appBuilder/revokeEntitlementRevoke an entitlement immediately (refund/abuse) — access ends now, audit trail kept
Parameters
projectId | stringrequired | Project ID |
appUserId | stringrequired | App user ID |
key | stringrequired | Entitlement key |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/revokeEntitlement \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"appUserId": "example",
"key": "example"
}'/api/v1/appBuilder/updateManualPaymentsConfigure the manual/cash payment method — members pay outside the platform, the owner verifies and approves
Parameters
projectId | stringrequired | Project ID |
enabled | boolean | Turn the manual/cash payment method on or off |
instructions | string | Shown to members at checkout: bank details, wallet handle, where to pay |
qrUrl | string | Legacy single QR image URL (kept as a one-method fallback). Prefer methods. |
methods | array | Labelled QR/wallet methods shown to members. Supersedes qrUrl. Pass [] or null to clear. |
notifyEmail | boolean | Email the owner on submit and the member on approve/reject |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateManualPayments \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"enabled": true,
"instructions": "example"
}'/api/v1/appBuilder/listManualPaymentsThe manual-payment approval queue: members' offline payments awaiting the owner's verification
Parameters
projectId | stringrequired | Project ID |
status | string | Filter — default "pending" (the approval queue) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listManualPayments \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"status": "example"
}'/api/v1/appBuilder/approveManualPaymentApprove a member's manual payment — marks it succeeded and grants the offer's entitlement per its access terms
Parameters
projectId | stringrequired | Project ID |
paymentId | stringrequired | Manual payment id (from listManualPayments) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/approveManualPayment \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"paymentId": "example"
}'/api/v1/appBuilder/rejectManualPaymentReject a member's manual payment claim (not received / wrong amount). No entitlement is granted
Parameters
projectId | stringrequired | Project ID |
paymentId | stringrequired | Manual payment id |
reason | string | Optional reason kept on the record |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/rejectManualPayment \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"paymentId": "example",
"reason": "example"
}'/api/v1/appBuilder/createAppUserManually create a user for this published app
Parameters
projectId | stringrequired | Project ID |
email | stringrequired | User email |
name | string | User name |
password | stringrequired | User password (min 8 chars) |
role | string | Legacy user/admin enum (kept for backward compat during the role-migration). |
roleIds | array | New-format role assignments. Each ID must be an AppBuilderRole for this project. Granted atomically with user creation. |
sendWelcomeEmail | boolean | Send welcome email with credentials |
customFields | object | Custom field values keyed by field ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createAppUser \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"email": "example",
"name": "example"
}'/api/v1/appBuilder/resetAppUserPasswordReset password for an app user
Parameters
projectId | stringrequired | Project ID |
userId | stringrequired | App user ID |
newPassword | stringrequired | New password (min 8 chars) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/resetAppUserPassword \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"userId": "example",
"newPassword": "example"
}'/api/v1/appBuilder/updateAppUserRoleLEGACY: set the platform-level user/admin classification. For has_role rules in access control, use assignRoleToAppUser / unassignRoleFromAppUser with roleIds from listProjectRoles.
Parameters
projectId | stringrequired | Project ID |
userId | stringrequired | App user ID |
role | stringrequired | LEGACY platform-level classification (user|admin). Retained for backward compat during the role-migration window. For access-control roles, use assignRoleToAppUser with a roleId from listProjectRoles. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateAppUserRole \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"userId": "example",
"role": "example"
}'/api/v1/appBuilder/updateAppUserUpdate an app user record (name, email, role, banned status, custom fields)
Parameters
projectId | stringrequired | Project ID |
userId | stringrequired | App user ID |
name | string | User name |
email | string | User email |
role | string | User role |
isBanned | boolean | Ban/unban user |
customFields | object | Custom field values matching authCustomFields |
profileData | object | Alias of customFields — custom field values matching authCustomFields, merged into existing profileData |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateAppUser \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"userId": "example",
"name": "example"
}'/api/v1/appBuilder/listProjectRolesList all role definitions for a project. Auto-seeds reserved + legacy roles.
Parameters
projectId | stringrequired | Project ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listProjectRoles \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/createProjectRoleCreate a new role on a project.
Parameters
projectId | stringrequired | Project ID |
name | stringrequired | Role name |
color | string | Hex color for UI badges |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createProjectRole \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example",
"color": "example"
}'/api/v1/appBuilder/updateProjectRoleUpdate a role on a project. The reserved app-super-admin role cannot be renamed.
Parameters
roleId | stringrequired | Role ID from listProjectRoles |
name | string | New role name |
color | string | New hex color (null clears) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateProjectRole \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"roleId": "example",
"name": "example",
"color": "example"
}'/api/v1/appBuilder/deleteProjectRoleDelete a role and all its assignments. The reserved app-super-admin role cannot be deleted.
Parameters
roleId | stringrequired | Role ID to delete |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteProjectRole \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"roleId": "example"
}'/api/v1/appBuilder/listAccessPoliciesList reusable access policies for a project.
Parameters
projectId | stringrequired | Project ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listAccessPolicies \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/createAccessPolicyCreate a reusable access policy. Reference it from a resource rule via { policy: <id> }.
Parameters
projectId | stringrequired | Project ID |
name | stringrequired | Unique policy name |
description | string | |
color | string | |
condition | anyrequired | The access Condition this policy represents (leaf, group, or legacy array). |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createAccessPolicy \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example",
"description": "example"
}'/api/v1/appBuilder/updateAccessPolicyUpdate a reusable access policy. Editing the condition updates every resource that references it.
Parameters
policyId | stringrequired | |
name | string | |
description | string | |
color | string | |
condition | any |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateAccessPolicy \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"policyId": "example",
"name": "example",
"description": "example"
}'/api/v1/appBuilder/deleteAccessPolicyDelete a reusable access policy. Resources still referencing it will DENY (fail-closed) until updated.
Parameters
policyId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteAccessPolicy \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"policyId": "example"
}'/api/v1/appBuilder/assignRoleToAppUserGrant a role to an app user. Idempotent.
Parameters
userId | stringrequired | App user ID |
roleId | stringrequired | Role ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/assignRoleToAppUser \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"userId": "example",
"roleId": "example"
}'/api/v1/appBuilder/unassignRoleFromAppUserRemove a role from an app user. Idempotent.
Parameters
userId | stringrequired | App user ID |
roleId | stringrequired | Role ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/unassignRoleFromAppUser \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"userId": "example",
"roleId": "example"
}'/api/v1/appBuilder/getAppUserRolesGet all roles assigned to an app user.
Parameters
userId | stringrequired | App user ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getAppUserRoles \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"userId": "example"
}'/api/v1/appBuilder/migrateProjectToRoleSystemIdempotent one-shot migration of legacy role data into the new AppBuilderRole model.
Parameters
projectId | stringrequired | Project to migrate |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/migrateProjectToRoleSystem \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/deleteProjectDelete a project, its linked Base, and all pages/components
Parameters
id | stringrequired | Project ID to delete |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteProject \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/createPageCreate a new page in a project. Set SEO title + description here for any public page so it ships indexable from day one — no follow-up updatePage call needed.
Parameters
projectId | stringrequired | Project ID from listProjects |
name | stringrequired | Page name (e.g., "About", "Contact") |
path | stringrequired | URL path (e.g., "/about", "/contact") |
title | string | SEO page title — 50-60 characters. Keyword-led, action-oriented. Example: "Pricing – Plans for Teams of Any Size". Leave empty for protected/auth pages and /404. |
description | string | SEO meta description — 150-160 characters. Action-oriented, includes value prop + key features. Example: "Compare Free, Pro, and Enterprise plans. Start free, upgrade for unlimited tasks, or pick Enterprise for SSO and SLA support." |
isHomePage | boolean | Set as the project home page (path "/"). Only one page can be home; setting this unsets any existing home. |
isProtected | boolean | Require authentication to access. Use for dashboards, settings, user-only content. Skip SEO meta on protected pages. |
content | string | Page content (React component code). Pages without content are skipped by publish — set it here or via updatePage before publishing. |
commitMessage | string | Git commit message describing what was created and why. Always provide a meaningful message. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createPage \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example",
"path": "example"
}'/api/v1/appBuilder/createComponentCreate a new component in a project
Parameters
projectId | stringrequired | Project ID from listProjects |
name | stringrequired | Component name |
description | string | Optional component description |
type | string | Component type: "custom", "layout", "ui", or "data" |
content | string | Component code (React/TSX). Set it here or via updateComponent — pages importing an empty component fail to build. |
isGlobal | boolean | Whether component is globally accessible |
commitMessage | string | Git commit message describing what was created and why. Always provide a meaningful message. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createComponent \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example",
"description": "example"
}'/api/v1/appBuilder/listPagesList all pages in a project
Parameters
projectId | stringrequired | Project ID from listProjects |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listPages \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/getPageGet page details including content
Parameters
id | stringrequired | Page ID from listPages |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getPage \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/readPageRead page content with line numbers. Use offset/limit to read specific sections of large files.
Parameters
id | stringrequired | Page ID from listPages |
offset | number | Line number to start from (1-indexed). If not specified, starts from line 1. |
limit | number | Number of lines to read. If not specified, reads entire file. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/readPage \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"offset": 0,
"limit": 0
}'/api/v1/appBuilder/readComponentRead component content with line numbers. Use offset/limit for large files.
Parameters
id | stringrequired | Component ID from listComponents |
offset | number | Line number to start from (1-indexed) |
limit | number | Number of lines to read |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/readComponent \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"offset": 0,
"limit": 0
}'/api/v1/appBuilder/getPageAccessRulesGet the access rules JSON for a single page.
Parameters
pageId | stringrequired | Page ID from listPages |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getPageAccessRules \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"pageId": "example"
}'/api/v1/appBuilder/setPageAccessRulesSet access rules on a page and sync legacy isProtected/requiredRole for Worker compatibility.
Parameters
pageId | stringrequired | Page ID from listPages |
accessRules | objectrequired | Pages have a single read/view operation. `read` is a Condition: a rule, a legacy flat array (OR), or an { all | any | not } group with operators. `function` rules are NOT allowed (the edge guard cannot run them). |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/setPageAccessRules \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"pageId": "example",
"accessRules": {}
}'/api/v1/appBuilder/getBackendFunctionAccessRulesGet the access rules JSON for a single backend function.
Parameters
functionId | stringrequired | Backend function ID from listBackendFunctions |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getBackendFunctionAccessRules \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"functionId": "example"
}'/api/v1/appBuilder/setBackendFunctionAccessRulesSet access rules on a backend function.
Parameters
functionId | stringrequired | Backend function ID from listBackendFunctions |
accessRules | objectrequired | Backend functions have a single execute operation. `execute` is a Condition: a rule, a legacy flat array (OR), or an { all | any | not } group with operators and the custom `function` rule. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/setBackendFunctionAccessRules \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"functionId": "example",
"accessRules": {}
}'/api/v1/appBuilder/getEmailAccessRulesGet who may send email from the published app (client-side email.send). Email is DENY-BY-DEFAULT for non-owners.
Parameters
projectId | stringrequired | Project ID from listProjects |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getEmailAccessRules \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/setEmailAccessRulesSet who may send email from the published app via the client-side email API. Server-side ctx.email.send() in backend functions is NOT affected (it runs as the project). Enforced at /api/email/send.
Parameters
projectId | stringrequired | Project ID from listProjects |
accessRules | objectrequired | { send: Condition } — same rule shapes as other resources (authenticated/has_role/user_property/policy refs or {all|any|not} groups). Empty/missing send = only the owner may send. NOTE: sending spends the owner's email quota under the owner's sender identity — open it narrowly (e.g. a staff role), not { type: "public" }. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/setEmailAccessRules \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"accessRules": {}
}'/api/v1/appBuilder/verifyBuildFast whole-project verification: per-file syntax/export/undefined-JSX checks, unresolved component imports, npm imports missing from project dependencies, and non-PascalCase component names (breaks publish). Call AFTER finishing edits and fix every reported error BEFORE telling the user the work is done. Warnings are advisory. Static check — publish still runs the full bundler.
Parameters
projectId | stringrequired | Project ID from listProjects |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/verifyBuild \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/updatePageUpdate page properties and content
Parameters
id | stringrequired | Page ID from listPages |
name | string | New page name |
path | string | New URL path |
content | string | Page content (React component code or JSON) |
layout | string | Layout template name |
isHomePage | boolean | Set as home page |
sortOrder | number | Sort order for navigation |
title | string | Page title for SEO |
description | string | Page description for SEO |
isDraft | boolean | Draft mode - page exists in builder but is not included when publishing |
isProtected | boolean | Require authentication to access |
requiredRole | string | Required role to access (null = any authenticated user) |
redirectIfUnauth | string | Redirect path for unauthenticated users |
commitMessage | string | Git commit message describing what changed and why. Always provide a meaningful message. |
baseContentHash | string |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updatePage \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"name": "example",
"path": "example"
}'/api/v1/appBuilder/editPageEdit page content by replacing specific text. Exact-match only — a near-miss fails and the error shows the file's actual nearby text to copy. If oldString is not unique, provide more surrounding context or use replaceAll=true.
Parameters
id | stringrequired | Page ID from listPages |
oldString | stringrequired | Exact text to find — matched byte-for-byte (whitespace/indentation included), NO fuzzy matching. Copy from readPage output WITHOUT the line-number prefixes, and do not add escaping the file does not contain (no \" or \n unless literally in the file). Must be unique in the file unless using replaceAll. |
newString | stringrequired | The replacement text (must be different from oldString) |
replaceAll | boolean | Replace all occurrences. If false (default), oldString must be unique in the file. |
commitMessage | string | Git commit message describing what changed and why. Always provide a meaningful message. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/editPage \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"oldString": "example",
"newString": "example"
}'/api/v1/appBuilder/searchPageSearch page content for specific text/patterns. Returns matching lines with context. More efficient than getPage for finding specific code.
Parameters
id | stringrequired | Page ID from listPages |
pattern | stringrequired | Text or regex pattern to search for |
contextLines | number | Number of lines to show before and after each match (default: 3) |
maxMatches | number | Maximum number of matches to return (default: 5) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/searchPage \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"pattern": "example",
"contextLines": 0
}'/api/v1/appBuilder/deletePageDelete a page from the project
Parameters
id | stringrequired | Page ID to delete |
commitMessage | string | Git commit message explaining why the page was deleted. Always provide a meaningful message. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deletePage \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"commitMessage": "example"
}'/api/v1/appBuilder/createEmailTemplateCreate a new email template in a project
Parameters
projectId | stringrequired | Project ID from listProjects |
name | stringrequired | Template display name (e.g., "Welcome Email") |
slug | stringrequired | Template slug used in email.send({ template: "slug" }) |
subject | string | Default email subject line |
description | string | Template description |
content | string | Initial HTML content for the template |
variables | array | Template variables |
commitMessage | string | Git commit message |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createEmailTemplate \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example",
"slug": "example"
}'/api/v1/appBuilder/listEmailTemplatesList all email templates in a project
Parameters
projectId | stringrequired | Project ID from listProjects |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listEmailTemplates \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/getEmailTemplateGet an email template with full content
Parameters
id | stringrequired | Email template ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getEmailTemplate \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/readEmailTemplateGet email template content with line numbers for AI editing
Parameters
id | stringrequired | Email template ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/readEmailTemplate \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/updateEmailTemplateUpdate an email template
Parameters
id | stringrequired | Email template ID |
name | string | Template display name |
slug | string | Template slug |
subject | string | Default subject line |
description | string | Template description |
content | string | Full HTML email template content |
variables | array | Template variables with source metadata |
commitMessage | string | Git commit message |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateEmailTemplate \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"name": "example",
"slug": "example"
}'/api/v1/appBuilder/editEmailTemplateReplace specific text in an email template (string replacement)
Parameters
id | stringrequired | Email template ID |
oldString | stringrequired | Exact string to find in the template content |
newString | stringrequired | Replacement string |
replaceAll | boolean | Replace all occurrences |
commitMessage | string | Git commit message |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/editEmailTemplate \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"oldString": "example",
"newString": "example"
}'/api/v1/appBuilder/searchEmailTemplateSearch for text in an email template
Parameters
id | stringrequired | Email template ID |
pattern | stringrequired | Search pattern (plain text or regex) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/searchEmailTemplate \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"pattern": "example"
}'/api/v1/appBuilder/deleteEmailTemplateDelete an email template
Parameters
id | stringrequired | Email template ID |
commitMessage | string | Git commit message |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteEmailTemplate \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"commitMessage": "example"
}'/api/v1/appBuilder/getEmailUsageGet email usage stats for the current month — both marketing/transactional and auth quotas
Parameters
projectId | stringrequired | Project ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getEmailUsage \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/listComponentsList all components in a project
Parameters
projectId | stringrequired | Project ID from listProjects |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listComponents \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/getComponentGet component details including content
Parameters
id | stringrequired | Component ID from listComponents |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getComponent \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/updateComponentUpdate component properties and code
Parameters
id | stringrequired | Component ID from listComponents |
name | string | New component name |
description | string | Component description |
content | string | Component code (React/TSX) |
type | string | Component type |
isGlobal | boolean | Whether globally accessible |
commitMessage | string | Git commit message describing what changed and why. Always provide a meaningful message. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateComponent \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"name": "example",
"description": "example"
}'/api/v1/appBuilder/editComponentEdit component content by replacing specific text. Exact-match only — a near-miss fails and the error shows the file's actual nearby text to copy. If oldString is not unique, provide more context or use replaceAll=true.
Parameters
id | stringrequired | Component ID from listComponents |
oldString | stringrequired | Exact text to find — matched byte-for-byte (whitespace/indentation included), NO fuzzy matching. Copy from readComponent output WITHOUT the line-number prefixes, and do not add escaping the file does not contain (no \" or \n unless literally in the file). Must be unique unless using replaceAll. |
newString | stringrequired | The replacement text (must be different from oldString) |
replaceAll | boolean | Replace all occurrences. If false (default), oldString must be unique. |
commitMessage | string | Git commit message describing what changed and why. Always provide a meaningful message. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/editComponent \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"oldString": "example",
"newString": "example"
}'/api/v1/appBuilder/searchComponentSearch component content for specific text/patterns. Returns matching lines with context.
Parameters
id | stringrequired | Component ID from listComponents |
pattern | stringrequired | Text or regex pattern to search for |
contextLines | number | Lines to show before/after match |
maxMatches | number | Maximum matches to return |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/searchComponent \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"pattern": "example",
"contextLines": 0
}'/api/v1/appBuilder/deleteComponentDelete a component from the project
Parameters
id | stringrequired | Component ID to delete |
commitMessage | string | Git commit message explaining why the component was deleted. Always provide a meaningful message. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteComponent \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"commitMessage": "example"
}'/api/v1/appBuilder/listSnapshotsList built-in version-history checkpoints for a project (paginated)
Parameters
projectId | stringrequired | |
limit | integer | |
cursor | string |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listSnapshots \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"limit": {},
"cursor": "example"
}'/api/v1/appBuilder/getSnapshotContentResolve a checkpoint's page/component content for preview
Parameters
projectId | stringrequired | |
snapshotId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getSnapshotContent \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"snapshotId": "example"
}'/api/v1/appBuilder/restoreSnapshotRestore the project to a previous version. Reversible — captures the current state first.
Parameters
projectId | stringrequired | |
snapshotId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/restoreSnapshot \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"snapshotId": "example"
}'/api/v1/appBuilder/revertSnapshotChangeUndo only the change a version/message made, keeping later changes (skips files later edited).
Parameters
projectId | stringrequired | |
snapshotId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/revertSnapshotChange \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"snapshotId": "example"
}'/api/v1/appBuilder/listOffersList ALL offers (active + inactive) with full terms.
Parameters
projectId | stringrequired | Project ID from listProjects |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listOffers \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/createOfferCreate a PRODUCT (a sellable thing: membership tier, course, pass, download). Buying it grants its entitlement; gate pages/tables/channels with has_entitlement rules. Tiers = multiple products with different entitlementKeys.
Parameters
projectId | stringrequired | Project ID from listProjects |
key | stringrequired | Stable id used by pages: payments.checkout(key). Lowercase, e.g. "pro" |
name | stringrequired | Display name, e.g. "Pro Membership" |
description | string | |
amount | integerrequired | Price in MINOR units (1900 = $19.00). 0 = free (trial offers) |
currency | string | ISO code, default usd |
paymentTerm | any | How it is paid. Default one_time. recurring {every:1,interval:"month"} = monthly; {every:3,interval:"month"} = quarterly; trialDays = free trial before the first charge (card checkout) |
accessTerm | any | How long access lasts. Default lifetime. while_subscribed pairs with recurring payment |
entitlementKey | string | Entitlement granted on payment (default = the product key). Gate content with { type: "has_entitlement", key } |
imageUrl | string | Product image URL shown on pricing/product cards |
features | array | Selling-point bullets, e.g. ["All courses", "Weekly live calls", "Private lounge"] |
isActive | boolean |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createOffer \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"key": "example",
"name": "example"
}'/api/v1/appBuilder/updateOfferUpdate an offer. Term changes affect FUTURE purchases only — existing members keep what they bought (grandfathering).
Parameters
projectId | stringrequired | |
key | stringrequired | Offer key from listOffers |
name | string | |
description | string | |
amount | integer | |
currency | string | |
paymentTerm | any | |
accessTerm | any | |
entitlementKey | string | |
imageUrl | string | |
features | array | |
isActive | boolean | false = stop selling (existing entitlements unaffected) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateOffer \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"key": "example",
"name": "example"
}'/api/v1/appBuilder/deleteOfferDelete an offer permanently. Prefer updateOffer isActive:false — deletion breaks pages referencing the key. Existing entitlements are never touched.
Parameters
projectId | stringrequired | |
key | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteOffer \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"key": "example"
}'/api/v1/appBuilder/listCouponsList discount coupons with redemption counts
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listCoupons \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/createCouponCreate a discount coupon. Multiple coupons can be active at once. Redemptions count only on PAID checkouts. The redeemed code lands in the entitlement source — usable for affiliate attribution.
Parameters
projectId | stringrequired | |
code | stringrequired | The code members type (stored UPPERCASE), e.g. LAUNCH20 |
percentOff | integer | Percent discount 1-100 (use EITHER this or amountOff) |
amountOff | integer | Fixed discount in MINOR units (500 = $5 off) |
offerKeys | array | Restrict to these offer keys (omit = all offers) |
maxRedemptions | integer | Total successful uses allowed (omit = unlimited) |
expiresAt | string | ISO date after which the code stops working |
isActive | boolean |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createCoupon \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"code": "example",
"percentOff": {}
}'/api/v1/appBuilder/updateCouponUpdate a coupon (isActive:false kills it instantly; past redemptions unaffected).
Parameters
projectId | stringrequired | |
code | stringrequired | Coupon code from listCoupons |
percentOff | integer | |
amountOff | integer | |
offerKeys | array | |
maxRedemptions | integer | |
expiresAt | string | |
isActive | boolean | false = disable the code immediately |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateCoupon \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"code": "example",
"percentOff": {}
}'/api/v1/appBuilder/deleteCouponDelete a coupon permanently.
Parameters
projectId | stringrequired | |
code | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteCoupon \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"code": "example"
}'/api/v1/appBuilder/listCampaignsList email campaigns with status + send stats
Parameters
projectId | stringrequired | Project ID from listProjects |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listCampaigns \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/createCampaignCreate a DRAFT email campaign. The audience is dynamic: an access-rule condition evaluated against live member data at send time.
Parameters
projectId | stringrequired | Project ID from listProjects |
name | stringrequired | Internal name, e.g. "July newsletter" |
subject | stringrequired | |
html | stringrequired | Email body HTML (an unsubscribe footer is added automatically) |
text | string | |
audienceRules | any | Access Control condition selecting recipients — SAME schema as page/table rules. Examples: [{"type":"has_entitlement","key":"pro"}] = paying Pro members; [{"type":"has_role","roleId":"..."}]; omit = ALL members. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createCampaign \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example",
"subject": "example"
}'/api/v1/appBuilder/updateCampaignUpdate a DRAFT campaign (sent/sending campaigns are immutable).
Parameters
projectId | stringrequired | |
id | stringrequired | Campaign ID from listCampaigns |
name | string | |
subject | string | |
html | string | |
text | string | |
audienceRules | any |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateCampaign \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"id": "example",
"name": "example"
}'/api/v1/appBuilder/deleteCampaignDelete a campaign (any status; stops future batches).
Parameters
projectId | stringrequired | |
id | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteCampaign \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"id": "example"
}'/api/v1/appBuilder/previewCampaignAudienceResolve the campaign audience NOW: recipient count, sample, suppressed count, and quota headroom. Always preview before sendCampaign.
Parameters
projectId | stringrequired | |
id | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/previewCampaignAudience \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"id": "example"
}'/api/v1/appBuilder/sendCampaignSend a draft campaign to its resolved audience. Draws from the combined marketing+transactional monthly quota; signup/password emails are a separate bucket and unaffected.
Parameters
projectId | stringrequired | |
id | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/sendCampaign \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"id": "example"
}'/api/v1/appBuilder/listSuppressionsList unsubscribed/suppressed email addresses (marketing only)
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listSuppressions \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/removeSuppressionRemove an address from the suppression list (only when the person explicitly re-opted-in).
Parameters
projectId | stringrequired | |
email | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/removeSuppression \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"email": "example"
}'/api/v1/appBuilder/getChannelAccessRulesList realtime channel access rules (pattern -> rules). Channels with no matching pattern allow any signed-in member.
Parameters
projectId | stringrequired | Project ID from listProjects |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getChannelAccessRules \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/setChannelAccessRulesSet access rules for a realtime channel pattern (upserts by pattern). Same rule engine as every other resource.
Parameters
projectId | stringrequired | Project ID from listProjects |
pattern | stringrequired | Channel pattern: exact ("announcements"), wildcard ("chat:*"), or dynamic with {self} = subscriber id ("support:{self}", "user:{self}:*") |
accessRules | objectrequired | Channels have a single `subscribe` operation. Same Condition schema as pages/tables/files: rules, flat arrays (OR), { all | any | not } groups. Example: { subscribe: [{ type: "has_entitlement", key: "pro" }] } |
description | string | |
sortOrder | integer | First matching pattern wins (ascending) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/setChannelAccessRules \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"pattern": "example",
"accessRules": {}
}'/api/v1/appBuilder/deleteChannelAccessRulesRemove access rules for a channel pattern.
Parameters
projectId | stringrequired | Project ID from listProjects |
pattern | stringrequired | Channel pattern to remove rules for (channel reverts to the any-member default) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteChannelAccessRules \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"pattern": "example"
}'/api/v1/appBuilder/setRealtimeGuestAccessEnable/disable anonymous guest realtime sessions (support-widget chat for non-logged-in visitors).
Parameters
projectId | stringrequired | Project ID from listProjects |
enabled | booleanrequired | Allow anonymous visitors to open guest realtime sessions (scoped to their own guest:{id}:* channels) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/setRealtimeGuestAccess \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"enabled": true
}'/api/v1/appBuilder/listSchedulesList scheduled backend-function runs (crons) for a project
Parameters
projectId | stringrequired | Project ID from listProjects |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listSchedules \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/createScheduleSchedule a backend function to run on a cron — drip, digests, reminders, sweeps
Parameters
projectId | stringrequired | Project ID from listProjects |
functionName | stringrequired | Backend function to run (name from listBackendFunctions) |
cronExpression | stringrequired | Cron expression, e.g. "0 9 * * 1" = Mondays 9am |
timezone | string | IANA timezone (default UTC) |
name | string | Display name, e.g. "Weekly digest" |
params | object | Extra params passed to the function |
isActive | boolean | Start enabled (default true) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createSchedule \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"functionName": "example",
"cronExpression": "example"
}'/api/v1/appBuilder/updateScheduleUpdate a schedule (fields omitted stay unchanged); isActive toggles it
Parameters
projectId | stringrequired | Project ID from listProjects |
id | stringrequired | Schedule ID from listSchedules |
functionName | string | |
cronExpression | string | |
timezone | string | |
name | string | |
params | object | |
isActive | boolean | Enable/disable the schedule |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateSchedule \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"id": "example",
"functionName": "example"
}'/api/v1/appBuilder/deleteScheduleDelete a schedule permanently (stop recurring runs)
Parameters
projectId | stringrequired | Project ID from listProjects |
id | stringrequired | Schedule ID from listSchedules |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteSchedule \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"id": "example"
}'/api/v1/appBuilder/listTriggersList all triggers (event-flow mappings) in a project
Parameters
projectId | stringrequired | Project ID from listProjects |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listTriggers \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/createTriggerCreate a trigger to execute a flow when an event occurs
Parameters
projectId | stringrequired | Project ID from listProjects |
event | stringrequired | Event type |
flowId | stringrequired | Flow ID to execute when event fires |
targetPageId | string | Page ID for page-specific events |
targetElementId | string | Element ID for element-specific events (button clicks, form submits) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createTrigger \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"event": "example",
"flowId": "example"
}'/api/v1/appBuilder/updateTriggerUpdate trigger settings
Parameters
id | stringrequired | Trigger ID from listTriggers |
flowId | string | New Flow ID |
isActive | boolean | Enable/disable trigger |
orderIndex | number | Execution order |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateTrigger \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"flowId": "example",
"isActive": true
}'/api/v1/appBuilder/deleteTriggerDelete a trigger
Parameters
id | stringrequired | Trigger ID to delete |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteTrigger \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/publishPublish an app to production. Builds all pages and deploys for serving.
Parameters
id | stringrequired | Project ID to publish |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/publish \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/unpublishUnpublish an app (marks as unpublished but keeps deployed files)
Parameters
id | stringrequired | Project ID to unpublish |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/unpublish \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/getCustomDomainStatusGet custom domain verification status and DNS instructions
Parameters
id | stringrequired | Project ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getCustomDomainStatus \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/verifyCustomDomainVerify custom domain ownership via DNS TXT record lookup
Parameters
id | stringrequired | Project ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/verifyCustomDomain \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/getCodeGuideGet docs for a SPECIFIC App Builder topic. Pass the topic you need (payments, auth, email, sdk, …). The SDK basics are already in your system prompt, so call this only when you need depth on a specific area — and pass a topic, not "all" (which returns just an index).
Parameters
topic | string | Pick the SPECIFIC topic you need (e.g. "payments", "auth", "email", "sdk", "styling"). "all" returns only a short index of topics, NOT full docs — request a specific topic for details. Topics: "sdk", "globals", "hooks", "navigation", "libraries", "styling", "components", "examples", "errors", "mcp", "access", "auth", "payments", "saas", "functions", "email". |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getCodeGuide \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"topic": "example"
}'/api/v1/appBuilder/removeCustomDomainRemove custom domain from a project
Parameters
id | stringrequired | Project ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/removeCustomDomain \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "example"
}'/api/v1/appBuilder/getStripeConnectionGet Stripe connection status for a project
Parameters
projectId | stringrequired | Project ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getStripeConnection \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/updateStripeConnectionSave Stripe API key and/or webhook secret for test or live mode
Parameters
projectId | stringrequired | Project ID |
mode | stringrequired | Which mode to update |
secretKey | string | Stripe Secret Key (sk_test_xxx or sk_live_xxx) |
webhookSecret | string | Stripe Webhook Secret (whsec_xxx) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateStripeConnection \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"mode": "example",
"secretKey": "example"
}'/api/v1/appBuilder/toggleStripeModeSwitch between test and live Stripe mode
Parameters
projectId | stringrequired | Project ID |
mode | stringrequired | Mode to switch to |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/toggleStripeMode \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"mode": "example"
}'/api/v1/appBuilder/syncStripeProductsSync products and prices from Stripe account
Parameters
projectId | stringrequired | Project ID |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/syncStripeProducts \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/listStripeProductsList synced Stripe products
Parameters
projectId | stringrequired | Project ID |
mode | string | Filter by mode (default: current mode) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listStripeProducts \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"mode": "example"
}'/api/v1/appBuilder/disconnectStripeRemove Stripe connection for test or live mode
Parameters
projectId | stringrequired | Project ID |
mode | stringrequired | Which mode to disconnect |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/disconnectStripe \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"mode": "example"
}'/api/v1/appBuilder/createStripeProductCreate a new product with price in Stripe
Parameters
projectId | stringrequired | Project ID |
name | stringrequired | Product name |
description | string | Product description |
amount | integerrequired | Price amount in cents (e.g., 999 = $9.99) |
currency | string | Currency code (default: usd) |
interval | string | Billing interval for subscriptions |
intervalCount | integer | Number of intervals between billings |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createStripeProduct \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example",
"description": "example"
}'/api/v1/appBuilder/getGitConnectionGet Git connection status. Param "projectId". Returns: connected, repoOwner, repoName, branch, lastCommitSha, AI permission flags.
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getGitConnection \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/connectGitHubConnect a GitHub repository. Params: projectId (required), repoOwner (GitHub username or org), repoName (repo name), OR createNew (true) with newRepoName to create a new repo.
Parameters
projectId | stringrequired | |
repoOwner | string | |
repoName | string | |
createNew | boolean | |
newRepoName | string |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/connectGitHub \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"repoOwner": "example",
"repoName": "example"
}'/api/v1/appBuilder/disconnectGitHubDisconnect GitHub from project. Param "projectId". Clears all Git settings and token.
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/disconnectGitHub \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/updateGitPermissionsUpdate AI Git permissions. Params: projectId (required), plus any of: - allowAiCommit: boolean - Allow AI to commit changes - allowAiPull: boolean - Allow AI to pull from remote - allowAiPush: boolean - Allow AI to push to remote - allowAiCreateBranch: boolean - Allow AI to create branches/repos
Parameters
projectId | stringrequired | |
allowAiCommit | boolean | |
allowAiPull | boolean | |
allowAiPush | boolean | |
allowAiCreateBranch | boolean |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateGitPermissions \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"allowAiCommit": true,
"allowAiPull": true
}'/api/v1/appBuilder/listGitHubReposList user GitHub repos for selection. Param "projectId". Returns array of {fullName, name, owner, private, defaultBranch}.
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listGitHubRepos \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/gitPullPull latest changes from GitHub remote
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/gitPull \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/gitPushPush commits to GitHub remote
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/gitPush \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/gitCommitCreate a new commit with current source files
Parameters
projectId | stringrequired | |
message | stringrequired | Commit message |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/gitCommit \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"message": "example"
}'/api/v1/appBuilder/gitCreateBranchCreate a new branch from current HEAD
Parameters
projectId | stringrequired | |
name | stringrequired | New branch name |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/gitCreateBranch \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example"
}'/api/v1/appBuilder/gitSwitchBranchSwitch to an existing branch
Parameters
projectId | stringrequired | |
name | stringrequired | Branch name to switch to |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/gitSwitchBranch \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example"
}'/api/v1/appBuilder/gitMergeMerge one branch into another
Parameters
projectId | stringrequired | |
from | stringrequired | Source branch to merge from |
to | stringrequired | Target branch to merge into |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/gitMerge \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"from": "example",
"to": "example"
}'/api/v1/appBuilder/gitListCommitsGet commit history
Parameters
projectId | stringrequired | |
limit | number | Maximum number of commits to return |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/gitListCommits \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"limit": 0
}'/api/v1/appBuilder/gitRollbackRestore project to a previous commit
Parameters
projectId | stringrequired | |
sha | stringrequired | Commit SHA to rollback to |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/gitRollback \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"sha": "example"
}'/api/v1/appBuilder/gitStatusGet current Git status
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/gitStatus \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/gitCreateRepoCreate a new GitHub repository
Parameters
projectId | stringrequired | |
name | stringrequired | Repository name |
isPrivate | boolean | Whether the repo should be private |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/gitCreateRepo \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example",
"isPrivate": true
}'/api/v1/appBuilder/gitListBranchesList all branches in the repository
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/gitListBranches \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/serverProxyMake an HTTP request through server-side proxy with env var placeholder resolution.
Parameters
projectId | stringrequired | |
url | stringrequired | |
method | string | |
headers | object | |
body | any | |
timeout | number |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/serverProxy \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"url": "example",
"method": "example"
}'/api/v1/appBuilder/setServerProxyAccessRulesSet access rules for server proxy on a project. Controls who can use serverFetch in published apps. No rules = deny (only app owner). Set execute rules to allow app users.
Parameters
projectId | stringrequired | |
accessRules | objectrequired | Access rules with a single execute operation. `execute` is a Condition: a rule, a legacy flat array (OR), or an { all | any | not } group with operators and the custom `function` rule. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/setServerProxyAccessRules \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"accessRules": {}
}'/api/v1/appBuilder/getServerProxyAccessRulesGet the current server proxy access rules for a project.
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getServerProxyAccessRules \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/listBackendFunctionsList all backend functions for a project — includes BOTH code functions AND data functions (kind: "data" vs "code" in each row). Params: projectId (required). Returns array with id, name, kind, description, code, definition, accessRules, timeout, isActive.
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/listBackendFunctions \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/appBuilder/getBackendFunctionGet a single backend function. Params: projectId (required), functionId (required). Returns full function with code.
Parameters
projectId | stringrequired | |
functionId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/getBackendFunction \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"functionId": "example"
}'/api/v1/appBuilder/createDataFunctionCreate a DATA function: a named declarative data operation — no code, no sandbox, entity-call speed. Callable from pages (as the member) AND headlessly by automations/agents (as system). Prefer these over backend functions for plain create/read/update/delete.
Parameters
projectId | stringrequired | |
name | stringrequired | Function name pages/automations call, e.g. "addContact" |
description | string | |
definition | objectrequired | One owner-locked declarative operation on one table. Callers can only fill the declared placeholders — they cannot change the table, operation, or widen filters. |
runAs | string | member (default) = caller's own row permissions. service = elevated (the declarative ctx.service) — use for public forms writing protected tables; combine with tight execute rules. |
accessRules | object | Who may call it. REQUIRED in practice — no rules = nobody can execute (secure by default). Public contact form: { execute: [{ type: "public" }] } with runAs "service". |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createDataFunction \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example",
"description": "example"
}'/api/v1/appBuilder/updateDataFunctionUpdate a data function (definition is re-validated; kind cannot change here — recreate to convert).
Parameters
projectId | stringrequired | |
functionId | stringrequired | Function id from listBackendFunctions |
description | string | |
definition | object | One owner-locked declarative operation on one table. Callers can only fill the declared placeholders — they cannot change the table, operation, or widen filters. |
runAs | string | |
accessRules | object |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateDataFunction \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"functionId": "example",
"description": "example"
}'/api/v1/appBuilder/createBackendFunctionCreate a server-side backend function (sandboxed JS with the ctx API) for secrets, elevated data access, external APIs, or heavy logic. For plain create/read/update/delete of table rows prefer createDataFunction. Read getCodeGuide topic "functions" first for the ctx API, patterns, and a worked example.
Parameters
projectId | stringrequired | Project ID from listProjects |
name | stringrequired | Function name pages call via functions.invoke("name", params) |
description | string | What the function does (shown in the Config panel) |
code | string | Sandboxed JS: export default async function(params, ctx) { ... }. ctx gives tables/service.tables/fetch/files/email/env/user — call getCodeGuide topic "functions" for the full ctx API and examples BEFORE writing code. |
accessRules | object | Who may call it from the published app: { execute: [...] }. No rules = nobody can execute (secure by default). |
timeout | number | Execution timeout in ms (default 10000, max 300000 = 5 min). Extend ONLY for slow work like LLM calls or big imports — long agentic jobs should be turn-based, not one long execution. |
maxRetries | integer | Retries when run by an automation on failure. 0 = run once (default). Set > 0 ONLY if this function is idempotent (safe to re-run). |
toolSpec | object | Structured MCP-tool schema authored WITH the code (one artifact): { inputSchema, outputSchema?, returns?, sideEffects? } as JSON Schema. A function with a schema is marked as an MCP tool (its interface is shown + AI-readable); omit it for a plain internal helper. |
exposed | boolean | true = a public METHOD of this site (catalog-listed, connectable). false (default) = internal helper. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/createBackendFunction \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"name": "example",
"description": "example"
}'/api/v1/appBuilder/updateBackendFunctionUpdate a backend function. Only provided fields are updated. Params: projectId (required), functionId (required), name, description, code, accessRules, timeout (1000-300000), isActive (boolean), maxRetries (0 = run once (default); > 0 only if idempotent — used when an automation runs it), toolSpec (structured MCP-tool schema { inputSchema, outputSchema?, returns?, sideEffects? } — update it TOGETHER with the code so they stay in sync; pass null to remove the schema).
Parameters
projectId | stringrequired | |
functionId | stringrequired | |
name | string | |
description | string | |
code | string | |
accessRules | object | |
timeout | number | |
maxRetries | integer | Retries when run by an automation on failure. 0 = run once. Set > 0 only if idempotent. |
isActive | boolean | |
toolSpec | object | Structured MCP-tool schema { inputSchema, outputSchema?, returns?, sideEffects? } authored WITH the code. Pass null to remove the schema (function becomes a plain internal helper). |
exposed | boolean | Expose/hide as a public method of this site. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/updateBackendFunction \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"functionId": "example",
"name": "example"
}'/api/v1/appBuilder/deleteBackendFunctionDelete a backend function OR data function permanently (both live in the same registry — check kind from listBackendFunctions). Params: projectId (required), functionId (required).
Parameters
projectId | stringrequired | |
functionId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/deleteBackendFunction \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"functionId": "example"
}'/api/v1/appBuilder/invokeBackendFunctionExecute/invoke a backend function and return the result. Use this to test functions after creating them. Params: - projectId: Project ID (required) - functionName: The function name (required, NOT the function ID) - params: Optional object of key-value parameters to pass to the function Returns: { success: true, data: <function return value>, executionTime: <ms> } or throws error with the function's error message. Example: invokeBackendFunction({ projectId: "abc", functionName: "getTaskStats", params: {} })
Parameters
projectId | stringrequired | |
functionName | stringrequired | |
params | object |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/appBuilder/invokeBackendFunction \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"functionName": "example",
"params": {}
}'