Apps API
Install the apps Serenities ships; build, save and release your own.
Endpoints
/api/v1/workspaceApp/setRecordAccessSet one record type of an installed app (a table its app.json declares) to "Mine only" or back to "All" (params: installId, the install id from workspaceApp_list; table, the record type's name from workspaceApp_getRecordAccess; scope, "mine" or "all"). With "Mine only", Developers and Viewers (anyone without "See every record when a record type is set to Mine only") see only the records they own through the app's own data steps (its screens' data and its step actions, also when the chat or an agent runs them), and another person's record answers "not found" to them there, exactly like a missing one; while any record type of the app is "Mine only", the app's base is closed to them in Databases and the database tools (it answers "not found", like a missing base), so the app is their door; an app's function they run follows the same scope; the Owner, the built-in Admin role, anyone who holds that permission, and automations see every record. Only record types whose app names an owner field can be "Mine only" (mayBeMine in workspaceApp_getRecordAccess); any other is refused naming it. In effect at once. Only the Owner or an Admin can change it (switching a record type back to "All" also needs the "See every record when a record type is set to Mine only" permission, and a refusal names whom to ask); call it only when asked, and repeat back the app, the record type and the choice. Returns { table, scope }.
Parameters
installId | stringrequired | The install id (from workspaceApp_list) |
table | stringrequired | The record type: the table's name in the app (from workspaceApp_getRecordAccess) |
scope | stringrequired | "mine": people without "See every record when a record type is set to Mine only" see only the records they own; "all": everyone who can open the app sees every record Allowed values: |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/setRecordAccess \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"installId": "example",
"table": "example",
"scope": "example"
}'/api/v1/workspaceApp/getRecordAccessEach record type of an installed app and whether it is "Mine only" or "All" (params: installId, the install id from workspaceApp_list). Returns { tables: [{ table, label, scope ("mine" or "all"; "all" when never set), mayBeMine (whether it can be "Mine only": the app names an owner field), needsOwnerField (only when it is "Mine only" but the app's version no longer names an owner field: then only people with "See every record when a record type is set to Mine only" see its records) }] }. Anyone who can open the app may read it: when a person sees fewer records than they expect, or a record answers "not found", this says whether the record type is "Mine only". A record type the app's version no longer declares but that is still stored as "Mine only" is listed too (inApp false, with a note): it keeps the app's base closed to people without "See every record when a record type is set to Mine only" until it is set back to "All" with workspaceApp_setRecordAccess, which removes it.
Parameters
installId | stringrequired | The install id (from workspaceApp_list) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/getRecordAccess \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"installId": "example"
}'/api/v1/workspaceApp/whatsNewWhat the app's last update changed (params: installId): null if never updated, else { from, to, added: { actions [{ name, title, on }], agents [{ template, title, agentId, asksLine, on }] }, removed: { actions, agents [{ template, title, agentId, on }] }, agentUpdates [{ agentId, name, fields }] }. A new agent starts off: workspaceApp_addAppAgent. An agent's new settings: aiAgent_templateDiff, aiAgent_applyTemplateFields.
Parameters
installId | stringrequired | The install id (from workspaceApp_list) |
unseenOnly | boolean | true: answer null once this person has seen it (the app screen asks so) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/whatsNew \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"installId": "example",
"unseenOnly": true
}'/api/v1/workspaceApp/addAppAgentMake and switch on an agent an app's update added (params: installId, template from workspaceApp_whatsNew). A card the person approves; one per template.
Parameters
installId | stringrequired | The install id (from workspaceApp_list) |
template | stringrequired | The agent's name in the app (template, from workspaceApp_whatsNew added.agents) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/addAppAgent \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"installId": "example",
"template": "example"
}'/api/v1/workspaceApp/listThe apps Serenities ships, with this account's install state (for example Social: a calendar and composer for the account's social channels). For each: installed or not, the install id to open it at /dashboard/apps/i/<installId>/open, the version it runs, whether a newer release exists (updateAvailable; updateHeld when it is a new major or SDK major: a new major waits for the person's OK, so update only when asked), access (what the app can access: the items its release declares, as its Permissions screen names them; empty when it declares nothing), and legacyProjectId when an older copy install has not yet moved onto a release. stage is "preview" when the install runs a Preview version (or the app has only a Preview), else "live"; preview is { version } when this workspace may install a newer Preview with workspaceApp_install({ key, version }) (only a workspace whose owner is on Serenities' team), else null.
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/list \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{}'/api/v1/workspaceApp/getInstallOne install of this account's (params: installId): its app, name, version, whether it is ready to open, latestVersion and updateAvailable (a new major or SDK major is never applied by itself, workspaceApp_list marks it updateHeld: a new major waits for the person's OK; update only when asked), access (what the version it runs can access, the same label workspaceApp_list shows), stage ("preview" when it runs a Preview version, else "live") and preview (a newer Preview this workspace may install, or null).
Parameters
installId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/getInstall \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"installId": "example"
}'/api/v1/workspaceApp/agentsOfThe AI agents one installed app came with (params: installId, from workspaceApp_list): { agents: [{ id, name, isActive, face }] }, only the agents this person may see; an install that is not here (or not theirs) answers as not installed. Open one with aiAgent_getSpecialist({ id }).
Parameters
installId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/agentsOf \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"installId": "example"
}'/api/v1/workspaceApp/usageHow many workspace apps this workspace has and how many its plan allows: { used, limit } (limit is null when the plan has no limit; 0 means the plan includes no workspace apps). Apps built here and apps installed from the app store count together. Check it before creating or enabling an app.
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/usage \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{}'/api/v1/workspaceApp/installEnable an official app for this account (params: key, e.g. "social"). One release of the app is built once and shared by everyone who has it; enabling creates a row and a base of the account's own — no copy, no build. Re-running moves an existing install to the newest release and is never refused (it never moves an install back to an older version). Optional version: leave it out for the newest Live version; a Preview version is installed only when workspaceApp_list offers it as preview (only in a workspace whose owner is on Serenities' team; anywhere else the call is refused saying only Live versions can be installed: tell the person that, never retry). The answer carries access: what the installed version can access, the same label workspaceApp_list shows. For an app that declares actions it also carries actionsNote: they are off for agents and automations until they are allowed, and the note says who allows them and the steps (appActions_setConsent, appActions_setAgents); tell the person. A NEW install is a workspace app and counts against the plan's limit on workspace apps: when the workspace is full, or its plan includes none, the call is refused with a plain message and an upgrade link — tell the person that message and give them the link, never retry. An app that comes with AI agents (its app.json `agents`) makes them on a NEW install, as the installer, all switched off: `agents` in the answer lists each with notes (what to connect, the app's actions to allow for it, a paid plan to run them); tell the person the notes and that they start an agent with aiAgent_updateSpecialist (isActive true). When those agents use the app's actions the answer also carries agentActionsNote: the actions to switch "Your AI agents" on for under "Who may run it" (appActions_setConsent); nothing is allowed for them for you, so tell the person. On a Free plan past its agent limit the install is refused naming the number.
Parameters
key | stringrequired | App key from list, e.g. "social" |
version | string | Leave out to install the newest Live version. A Preview version, as workspaceApp_list offers it in `preview` (only in a workspace whose owner is on Serenities' team) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/install \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"key": "example",
"version": "example"
}'/api/v1/workspaceApp/uninstallRemove an official app from this account (params: key). A workspace's own app (its key starts with own:) is refused: it was built here, delete it in the builder. Deletes the install row; the account's base, social channels and posts are kept, and nothing of the vendor's is touched. The AI agents the app made are stopped and deleted (their run history stays); keepAgents true keeps them, switched off and no longer tied to the app. Act only on what the person named or picked.
Parameters
key | stringrequired | App key from list, e.g. "social" |
keepAgents | boolean | true: keep the AI agents the app made (switched off, no longer tied to the app). Left out: they are stopped and deleted; their run history stays |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/uninstall \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"key": "example",
"keepAgents": true
}'/api/v1/workspaceApp/pausePause one installed app (params: installId): a safety stop. While paused, people can still open it and read, but nothing it does can change anything (writes, sends, its automations and agents are refused, and say it is paused). Undo with workspaceApp_resume. Pausing an app that is already paused changes nothing.
Parameters
installId | stringrequired | The install id (from workspaceApp_list) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/pause \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"installId": "example"
}'/api/v1/workspaceApp/resumeResume an app a person paused (params: installId). The person who paused it may; when you may not, the refusal says whom to ask. An app paused by the platform (over the plan's app count, or its daily limit) cannot be resumed here: it starts again by itself when the cause clears, and the refusal says what to do. Resuming a running app changes nothing. Only a person resumes an app: flows, functions and agents are refused.
Parameters
installId | stringrequired | The install id (from workspaceApp_list) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/resume \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"installId": "example"
}'/api/v1/workspaceApp/createReleaseSave app: a Preview release of this workspace's own app (params: projectId, notes, checkOnly; manifest is not read: the app.json in its files is what is saved). Builds from the app's FILES (their current version): the app needs its files first (app.json for SDK 2 with its version x.y.z, its pages and its functions, written with workspaceApp_filesWrite); an app with no files is refused and a pages-only app has to get its files first; nothing runs a Preview. Refused naming the key when app.json is wrong or removes what Live has. Each save builds (paid): 10 an hour per workspace, then refused saying how long to wait. checkOnly: true runs every check of a save with no build, no credits, and not counted in that limit (answers { version, stage: "checked" }): use it to test app.json before saving. An app's actions ask the owner first: the first run shows a pending card the OWNER allows, and an outside AI can never approve its own pending action (tell the person a card is waiting). Listing or selling a workspace app on the Serenities Store is not open to users yet; to charge for what they build, they sell it through their site's payments.
Parameters
projectId | stringrequired | |
manifest | object | Not needed: the app's own app.json (in its files) is what is saved |
notes | array | |
checkOnly | boolean | true: only run every check of a save (app.json, version, what Live has) and answer { version, stage: "checked" }: nothing is built, no credits are used, and it is not counted in the saves an hour (checks have their own light limit, 60 an hour per workspace). Refused with the same words as a real save when something is wrong. |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/createRelease \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"manifest": {},
"notes": {}
}'/api/v1/workspaceApp/promoteReleaseMake a saved Preview of this workspace's own app Live for the whole workspace (params: projectId, version). Refused naming the field when it removes what Live has now.
Parameters
projectId | stringrequired | |
version | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/promoteRelease \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"version": "example"
}'/api/v1/workspaceApp/rollbackReleaseMove this workspace's own app back to an earlier version that was Live (params: projectId, version); later versions are no longer offered.
Parameters
projectId | stringrequired | |
version | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/rollbackRelease \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"version": "example"
}'/api/v1/workspaceApp/listReleasesThe versions of this workspace's own app (params: projectId): version and stage (live, earlier, preview; Previews only when you may create apps).
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/listReleases \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/workspaceApp/updateListingUpdate an app's LISTING: the copy of its public page (tagline, features, FAQ, use cases, industries), any time, WITHOUT a release (params: projectId, marketing). No new version, nothing built, no credits, no install moves; a Store app's public page and the sitemap show it within 5 minutes and /llms.txt within an hour; a workspace's own app has no public page yet. marketing is the WHOLE block exactly as app.json's marketing object (the same rules and caps): { "slug", "tagline", "features": [{ "title", "body" }], "faq": [{ "question", "answer" }], "useCases"?: [{ "title", "body" }], "industries"?: [{ "slug", "name", "body" }] }; read the current one first and send it back changed. Refused, naming each problem in app.json's words, when the block is wrong; when it has fewer than two features (the page would go); when slug is not the app's page address now (the address moves only with a release); or when another app uses it. Any app of this workspace (one it sells on the Store or one it built); every update is kept in workspaceApp_listingHistory. 60 updates an hour per workspace, then refused saying how long to wait. Once a listing was updated, a later release's app.json marketing no longer changes the page: update the listing instead.
Parameters
projectId | stringrequired | The app's project id |
marketing | any | The whole listing, exactly as app.json's marketing object: { slug (the app's page address, unchanged), tagline, features [{ title, body }] (at least two), faq [{ question, answer }], and optionally useCases [{ title, body }] and industries [{ slug, name, body }] }; no price |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/updateListing \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"marketing": {}
}'/api/v1/workspaceApp/listingHistoryThe earlier versions of an app's listing, newest first (params: projectId, limit 1-50, cursor = nextCursor from the page before): each { id, at, by: { kind ("person", or the automation's kind: "agent", "flow", "function", "app"), name }, marketing } holds the block an update REPLACED, and who made that update. The newest 200 are kept. To restore one, send its marketing to workspaceApp_updateListing (that is itself a new entry).
Parameters
projectId | stringrequired | |
limit | integer | Entries a page, 1 to 50 (20 when left out) |
cursor | string | nextCursor from the page before |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/listingHistory \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"limit": {},
"cursor": "example"
}'/api/v1/workspaceApp/filesListThe source files of this workspace's own app (params: projectId): headHash (the current version; null when it has no files yet), updatedAt, and each file's path, size and hash. Pass headHash as expectedHeadHash to workspaceApp_filesWrite / filesEdit / filesRename / filesDelete / filesRestore.
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/filesList \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/workspaceApp/filesReadRead one source file of this workspace's own app (params: projectId, path from workspaceApp_filesList): a text file answers its whole content; an image or font answers its size and type, never its bytes.
Parameters
projectId | stringrequired | |
path | stringrequired | A file path from workspaceApp_filesList, e.g. "pages/Home.tsx" |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/filesRead \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"path": "example"
}'/api/v1/workspaceApp/filesWriteSave one source file of this workspace's own app, whole (params: projectId, path, content, expectedHeadHash = headHash from workspaceApp_filesList; left out for the first file of an app with no files). BIG FILE (an app.json of about 20 KB or more, a long page): do not send it as content, because every character would pass through you; instead call files_createUploadTicket (fileName, exact sizeBytes), PUT the bytes to its uploadUrl, then call this tool with fileId (the id the upload answers) INSTEAD of content (give content or fileId, never both). The file must be a Drive file of this workspace that you may see, UTF-8 text, and is held to exactly the same rules as content; it stays in Drive afterwards (delete it with files_delete when no longer needed). Makes a new version (earlier ones are listed by workspaceApp_filesHistory); nothing goes live until a release. Refused when someone saved first (list again, redo the change), when it breaks a file rule (path, 1 MB per file, 500 files, 25 MB) or holds a secret (declare it in app.json instead). Writing app.json also runs the save check and answers its problems as "warnings" (the file is still saved): fix them before workspaceApp_createRelease.
Parameters
projectId | stringrequired | |
path | stringrequired | e.g. "pages/Home.tsx": app.json, or a file in one of the folders pages, components, functions, assets, api, agents, skills |
content | string | The whole file, as text (UTF-8). For a big file (about 20 KB or more, an app.json especially) use fileId instead, so the text does not pass through you. |
fileId | string | Instead of content: the id of a Drive file of this workspace that holds the whole file as UTF-8 text (get one with files_createUploadTicket, PUT the bytes to its uploadUrl, use the fileId the upload answers). The same rules as content (1 MB, no secret, same path rule). Give content or fileId, not both. |
expectedHeadHash | stringnull | headHash from workspaceApp_filesList; leave it out for the first file of an app with no files |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/filesWrite \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"path": "example",
"content": "example"
}'/api/v1/workspaceApp/filesDeleteRemove one source file of this workspace's own app (params: projectId, path, expectedHeadHash = headHash from workspaceApp_filesList). Makes a new version (earlier ones are listed by workspaceApp_filesHistory); the last file cannot be removed. Undo it with workspaceApp_filesRestore (headHash = the version before the delete, first in workspaceApp_filesHistory).
Parameters
projectId | stringrequired | |
path | stringrequired | |
expectedHeadHash | stringrequired | headHash from workspaceApp_filesList |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/filesDelete \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"path": "example",
"expectedHeadHash": "example"
}'/api/v1/workspaceApp/filesHistoryThe earlier versions of this workspace's own app's files, newest first, at most 100 (params: projectId): headHash, when it was replaced, and who had saved it (a person's name and role, or an automation's name and kind). Pass a headHash to workspaceApp_filesRestore to make that version current again.
Parameters
projectId | stringrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/filesHistory \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example"
}'/api/v1/workspaceApp/filesEditChange one passage of one text file of this workspace's own app (params: projectId, path, find, replace, expectedHeadHash = headHash from workspaceApp_filesList): `find` must occur exactly once in the file (copy it exactly, with enough around it to match one place; 0 or several matches are refused, saying how many) and becomes `replace`. Makes a new version, held to the same rules as workspaceApp_filesWrite (1 MB per file, 25 MB, no secret); nothing goes live until a release.
Parameters
projectId | stringrequired | |
path | stringrequired | A text file path from workspaceApp_filesList, e.g. "pages/Home.tsx" |
find | stringrequired | The exact text to change; it must occur exactly once in the file |
replace | stringrequired | The text to put in its place (empty removes it) |
expectedHeadHash | stringrequired | headHash from workspaceApp_filesList |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/filesEdit \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"path": "example",
"find": "example"
}'/api/v1/workspaceApp/filesRenameRename or move one source file of this workspace's own app (params: projectId, from, to, expectedHeadHash = headHash from workspaceApp_filesList). The file keeps its content; `to` must follow the file path rules and must not exist yet. Makes a new version, undone with workspaceApp_filesRestore.
Parameters
projectId | stringrequired | |
from | stringrequired | The file's path now, from workspaceApp_filesList |
to | stringrequired | Its new path (the same file rules as a write) |
expectedHeadHash | stringrequired | headHash from workspaceApp_filesList |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/filesRename \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"from": "example",
"to": "example"
}'/api/v1/workspaceApp/filesRestoreMake an earlier version of this workspace's own app's files current again (params: projectId, headHash = an earlier version from workspaceApp_filesHistory, expectedHeadHash = headHash from workspaceApp_filesList). It is a new version: the one it replaces goes to workspaceApp_filesHistory, so a restore is undone the same way. Refused when a file of that version is no longer stored.
Parameters
projectId | stringrequired | |
headHash | stringrequired | The earlier version to make current: a headHash from workspaceApp_filesHistory |
expectedHeadHash | stringrequired | headHash from workspaceApp_filesList (the version now) |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/workspaceApp/filesRestore \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"projectId": "example",
"headHash": "example",
"expectedHeadHash": "example"
}'