# Connect your AI > Give Claude Code, Codex, Cursor, ChatGPT or any MCP client its own governed access to your pod. URL: https://doc.synap.live/docs/agents · Last reviewed against the code: 2026-10-20 An agent connects to your pod with its **own identity and key**. What it writes goes through the pod's governance: by default its creates and edits apply directly and can be undone, while deletions, schema and structural changes, and admin actions become proposals you approve. You can see and revoke each agent separately. The user CLI, `@synap-core/cli`, does the wiring for you. ## The short path ```bash npx @synap-core/cli init ``` `init` finds or creates your pod, approves this computer, and connects the agents it detects on it (Claude Code, Codex, Cursor). See the [Cloud quickstart](/docs/start/cloud-quickstart). ## Connect one agent ```bash synap connect claude-code synap connect --list # everything that can be connected synap connect cursor --workspace # focus on one workspace (default: pod-wide) synap connect codex --project # focus on one project ``` `connect` creates the agent's identity on your pod, gives it a key, and writes the client's configuration. For clients that read skill folders, it also installs the [Synap skills](/docs/agents/skills). You choose how the agent's changes land: **Normal** (recommended: creates and edits apply directly with Undo; deletions and structural changes ask you), **Creates only** or **Ask first**. `synap init` asks on the page where you approve the computer; `synap connect claude-code` asks in the terminal. You can change it later on the agent's page in the pod admin console. See [Validation policy](/docs/concepts/validation-policy). | Target | Client | |---|---| | `claude-code` | Claude Code (MCP and skills) | | `codex` | OpenAI Codex (MCP and skills) | | `cursor` | Cursor | | `claude-desktop` | Claude Desktop | | `chatgpt` | ChatGPT, with an API-key connector | | `chatgpt-oauth` | ChatGPT, through Control Plane OAuth (no key to paste) | | `raycast` | Raycast. See [Raycast](/docs/use/raycast). | | `windsurf`, `zed`, `goose`, `opencode`, `openwebui`, `grok` | Those clients' MCP configuration | | `vscode` | VS Code MCP extensions (Kilo Code, Cline, Continue, Copilot) | | `aider` | aider | | `generic` | Any other MCP client: prints a URL and key to paste | ## Clients you configure in a web UI For ChatGPT, claude.ai and other clients configured in a browser: ```bash synap mcp url --client chatgpt # a dedicated key plus the URL and ready-to-paste snippets synap mcp ui-setup cursor # the exact form fields to fill in for a client synap mcp connect-claude # the claude.ai steps: paste a URL, approve in the browser ``` ## Your own agent For an agent you wrote yourself: ```bash synap agents add --name researcher ``` prints an MCP URL and a key for a new agent identity named `researcher`. `--role admin|editor|viewer` sets its workspace role (default `editor`). ## Check the connection ```bash synap mcp verify # is /mcp reachable, and is the key valid synap doctor # does each configured key work, and why or why not synap whoami # who the key acts as, and its scopes synap agents list # your agents on this pod ``` ## What an agent can and cannot do - It works through MCP or the Hub REST API, with the scopes and grant of its key. See [API keys](/docs/build/api-keys#limiting-an-agent) to limit what it may change. - Its writes follow its write mode. Under the default, creates and edits apply directly with Undo; deletions and structural changes become proposals. Deletes, admin actions, scope changes, new kinds and roles, and new spaces, cells, playbooks and automations are always proposals, whatever rule you set. - It can never approve a proposal, its own or anyone else's. - It cannot create keys for other agents, widen its own approval rules, or give itself vault access. ## In this section # MCP > The MCP endpoint every pod serves, how clients authenticate to it, and what it exposes. URL: https://doc.synap.live/docs/agents/mcp · Last reviewed against the code: 2026-10-20 Every pod serves a Model Context Protocol (MCP) server at `/mcp`, for example `https://pod.example.com/mcp`. AI clients use it to read your pod and to change it, under the permissions of their key and the agent's write mode. Most people never configure it by hand: `synap connect ` writes the client's MCP configuration. See [Connect your AI](/docs/agents). ## Transport MCP Streamable HTTP: | Request | Purpose | |---|---| | `POST /mcp` | A JSON-RPC 2.0 request. The answer is JSON or an SSE stream. | | `GET /mcp` | An SSE stream for messages the server initiates. | | `DELETE /mcp` | Ends the session. | The server negotiates the protocol version with the client; it is not pinned to one revision. ## Authentication Send a key as a bearer token: ``` Authorization: Bearer ``` - A request without a valid key gets `401` with a `WWW-Authenticate: Bearer resource_metadata="…"` header pointing at the pod's OAuth metadata (`/.well-known/oauth-protected-resource`). Clients such as claude.ai use it to sign in through the pod's own OAuth server and obtain a key, with no key to paste. - Too many requests get `429`. ## Scopes The tools a key can call depend on its scopes: | Key scope | MCP access | |---|---| | `mcp.read`, `hub-protocol.read` or `data.read` | read tools | | `mcp.write`, `hub-protocol.write` or `data.write` | read and write tools | | `hub-protocol.admin` | read and write tools | A key with none of these can call no tool. A key whose grant is narrower than full access can read only through the tools whose reads its grant bounds; other read tools answer `GRANT_DOOR_UNSUPPORTED`. See [API keys](/docs/build/api-keys#doors-a-scoped-key-can-read-through). ## Governance Every write tool goes through the same permission check as any other write to the pod, then through the [validation policy](/docs/concepts/validation-policy). Under the default write mode, creates and edits apply directly and can be undone; deletions, schema and structural changes, and admin actions become a proposal that a person approves. A tool that answers `status: "proposed"` has succeeded: the change waits for review. No MCP tool can approve a proposal with an agent's key. ## Tools All tool names start with `synap_`, for example `synap_ask` to ask the pod a question in natural language. A new agent key lists a small entry set of tools and loads the others in groups. [MCP tools](/docs/reference/mcp-tools) lists every tool with its parameters, generated from the backend's tool definitions. ## Test the endpoint ```bash synap mcp verify ``` checks that `/mcp` answers and that your key is valid. # Agent skills > The skill packages that teach an agent how to work with a Synap pod, and how they are installed. URL: https://doc.synap.live/docs/agents/skills · Last reviewed against the code: 2026-10-20 A skill is a folder an agent reads to learn a job: a `SKILL.md` with a short description that tells the agent when to use it, plus reference files it reads only when the task needs them. Synap's skills teach an agent how to work with your pod: what to store where, how to extend the schema, how to build views, and how proposals work. The skills are open source, in the [`skills/`](https://github.com/Synap-core/backend/tree/main/skills) folder of the backend repository. `skills/manifest.json` is the list of packages and says which are installed by default. ## Baseline skills Installed by default for every agent that reads skill folders. | Skill | Use it for | |---|---| | `synap` | Core data work: capture, remember, find and link things in your pod. "Save this", "Find my notes on X", "Who is Y". | | `synap-schema` | Extending the data model: a new kind of thing, or new fields on an existing kind. | | `synap-ui` | Building interface over your data: views, dashboards, bento layouts and whole workspaces. | | `synap-design` | Designing and reviewing user interface for Synap or for a UI over your pod. | ## Workflow skills Installed only when you or the client asks for them, because each is for one kind of task. | Skill | Use it for | |---|---| | `onboard` | Setting up a workspace or project that has little or no data yet. | | `agent-os` | Provisioning workspaces from templates, for example "add a CRM". | | `synap-app` | Building your own app on Synap with the SDK. | | `synap-market` | Finding, installing, authoring and publishing marketplace templates, capabilities, automations and cells. | ## How skills are installed `synap connect ` and `synap init` install the baseline skills for clients that read skill folders, such as Claude Code (`~/.claude/skills/`) and Codex. The CLI takes the skills from your pod (`/api/hub/skills/system`), so they match the pod's version. Clients that do not read skill folders, such as Cursor, still get the pod's tools over [MCP](/docs/agents/mcp). ## What a skill needs The skills call your pod over HTTP with the agent's key: ``` Authorization: Bearer X-Workspace-Id: optional ``` Reads need the `hub-protocol.read` scope and writes need `hub-protocol.write`. `synap connect` sets this up. ## How a skill loads An agent always sees each installed skill's name and description, which costs a few dozen tokens per skill. It reads the skill's `SKILL.md` only when the task matches the description, and the reference files only when it needs them. Installing all the baseline skills is therefore cheap. ## Contributing a skill Some packages are split into topic files: when a package has a `_skill.yaml` (its front matter) and an `_order.txt` (the order of its topic files), its `SKILL.md` is generated from them by `skills/build.mjs`. In those packages, edit the topic files, not `SKILL.md`. See [Community](/docs/community). # API keys > Create, scope, grant and revoke the keys that apps, scripts and agents use to call your pod. URL: https://doc.synap.live/docs/build/api-keys · Last reviewed against the code: 2026-10-20 An API key is a bearer token for an app, site, script or AI agent that calls your pod. It has two limits: - Its **scopes** say which API surfaces it may call, one coarse gate per surface. - Its **grant** says what it may touch there: kinds, actions, workspaces, projects or single objects. A key can never do more than the person it acts for. Effective access is always *grant ∩ what you can see and do*. ## Creating a key 1. Open your pod's admin console (for example `https://pod-admin.example.com`) and go to **Keys**. A key for a single workspace is created from that workspace's **API keys** tab instead. 2. Click **New key** and name it after what will use it (for example "Portfolio site", "n8n"). 3. Pick its scopes and its grant. The key is shown **once**, so copy it immediately. Only a hash is stored. For an AI agent, do not create a key by hand: `synap connect ` (from `@synap-core/cli`) gives each agent its own key and identity. See [Connect your AI](/docs/agents). To create one programmatically, call the tRPC procedure `apiKeys.create`. `keyName`, `scope` (at least one) and `grant` are required: ```json { "keyName": "Portfolio site", "scope": ["hub-protocol.read"], "expiresInDays": 90, "grant": { "permissions": ["entity.portfolio.read", "document.read"], "workspaceIds": [""], "label": "Portfolio site" } } ``` ## Grants: what a key may touch A grant is a list of **permissions** plus optional **resource sets**. Permissions use the same keys as Synap's governance events, with an optional **kind** in the middle: ``` [.]. ``` | Permission | Allows | |---|---| | `*` | everything you can do (an explicit full-access key) | | `entity` | every action on every entity | | `entity.knowledge` | every action on `knowledge` entities | | `entity.knowledge.read` | reading `knowledge` entities only | | `entity.*.read` or `entity.read` | reading every kind | | `entity.*.create` | creating any kind | | `document.read` | reading documents | | `view.read`, `project.read`, `session.read` | reading views, projects, sessions | Matching is segment by segment. `*` stands for one segment, and a shorter permission covers everything under it: `entity.knowledge` covers `entity.knowledge.read` and `entity.knowledge.update`. There is no partial-word wildcard. **Resource sets** narrow further. Leave a set out for no narrowing on that axis. | Field | Narrows to | |---|---| | `workspaceIds` | those workspaces | | `projectIds` | objects filed in those projects | | `entityIds` | those exact objects | How it is enforced: - **Reads** are filtered in the pod's access layer, so a key with `entity.portfolio.read` never sees other kinds. - **Writes** are checked at the governance gate before anything else. A write outside the grant is **refused**, never queued for approval. - A grant **permits**, it never auto-approves. An agent's writes inside the grant still follow its write mode and the [validation policy](/docs/concepts/validation-policy): some apply directly with Undo, others become proposals. - A write that creates related objects (links, files) needs those subjects in the grant too. - A key with no grant keeps the older behaviour: its scopes plus everything you can see. ### Doors a scoped key can read through A key whose grant is narrower than `*` can only **read** through doors whose reads the grant actually bounds. Every other read door answers `403 GRANT_DOOR_UNSUPPORTED`; doors are added as they are migrated. | Surface | Read doors open to scoped keys | |---|---| | Hub REST (`/api/hub`) | `GET /users/me`, `/auth/status`, `/entities` (listing; a full-text `q` search is refused), `/users/{id}/entities`, `/entities/{id}`, `/entities/{id}/connections`, `/entities/{id}/facets`, `/documents/{id}`, `/documents/{id}/raw`, `/relations`, `/projects`, `/projects/{id}`, `/projects/{id}/digest`, `/projects/{id}/outputs`, `/tracks`, `/tracks/{id}`, `/views`, `/proposals`, `/channels`, `/threads`, `/threads/{id}/messages`, `/threads/{id}/branches`, `/messaging/channels`, `/messaging/linked-unread`, `/focus-sessions`, `/artifacts`, `/commands`, `/commands/{id}`, `/brand/kit`, and `/webhooks` (the key's own subscriptions) | | MCP | `synap_get_entities`, `synap_get_document`, `synap_get_relations`, `synap_list_tracks`, `synap_resolve_identity`, `synap_get_project`, `synap_list_projects`, `synap_list_views` | | tRPC bridge (`/api/hub/trpc`) | `entities.getEntities`, `documents.getDocument`, `relations.listRelations`, `relations.listRelationsPodWide`, `automations.listRuns`, `automations.getRun`, `commands.listCommands`, `commands.getCommand`, `views.listViews`, `proposals.listProposals` | `GET /entities` without `q` and `GET /webhooks` are open to scoped keys. Doors that combine several kinds of record (`POST /knowledge/search`, `/knowledge/ask`, `/knowledge/answer`, `/entities/retrieve` and `/memory/search`, and MCP read tools such as `synap_ask`, `synap_orient` and `synap_find`) cannot filter row by row yet. A scoped key passes one only when its grant reads every kind of record the door reads, with no workspace, project or object limit. Every other read door (for example the REST graph, events and runs) needs a key with the full-access `*` grant. Writes go through to the governance gate, which applies the grant. Two kinds of write need a key with unrestricted `*` (no workspace, project or object limit): doors that act on everything the person owns and that no grant can narrow (for example the calendar feed URL, connector credentials and disconnection, and deleting a vault secret), and, on the tRPC bridge, mutations the gate cannot bound yet. ### Access roles: reusable grants Save a grant under a name in the Browser app (**Settings → AI → Access roles**), or with **Save as role** in any access editor. The next key, app or agent can start from it. - A role is a **template**. A key made from a role keeps what the role said at that moment. Editing the role later never changes an existing key. - The key remembers which role it came from. Pass `grant.roleId` when minting through the API; it must be one of your own roles. - Only you can create or change your roles. Your agents can list them but never edit them. ### Limiting an agent An agent's **capabilities** use the same permission keys. In the agent's panel, the same editor limits what it may **change**, down to one kind (`entity.knowledge.update`). An agent can always **read** what you can read, so the read column is shown on and locked. Leaving every box unticked makes the agent read-only. It never reverts to full access. ## Lifetime `expiresInDays` sets how long a key lives: | Value | Lifetime | |---|---| | omitted | **90 days** (the default) | | a number (1–36500) | that many days | | `null` | **never expires**. Choose this deliberately. | Rotating a CLI key keeps its remaining lifetime. ## Key formats The prefix tells you what kind of key it is: | Prefix | Key | |---|---| | `synap_user_` | A personal key, created for you or for one workspace | | `synap_hub_live_` | A service key (system-wide, or registered for a hub) on a production pod | | `synap_hub_test_` | The same kind of service key on a pod not running in production mode | ## Scopes: which surfaces a key can call | Scope | Gate | |---|---| | `hub-protocol.read` / `hub-protocol.write` | the Hub REST API (`/api/hub/*`), including its tRPC bridge (`/api/hub/trpc`) | | `hub-protocol.admin` | treated as `hub-protocol.write` by every door; it only marks the key as privileged when it is created | | `mcp.read` / `mcp.write` | the MCP endpoint (`/mcp`) | | `data.read` / `data.write` | aliases of `hub-protocol.*`, honoured on `/mcp` only | | `skills.invoke` | `/api/external/skills` | | `chat.stream` | `/api/external/chat` and the OpenAI-compatible endpoint | | `read:entities` / `write:entities` / `ai:analyze` | the n8n integration routes | | `realtime:observe` | read-only realtime subscriptions | | `providers.write` | AI provider configuration (operator tools only) | | `setup.agent` | `POST /api/hub/setup/agent`, to provision agents on the pod | | `probe` | marks writes as test probes, hidden from listings | Older keys may still carry retired scopes (`preferences`, `notes`, `tasks`, …). No door ever checked them, and new keys cannot be minted with them. ## Workspace-bound keys A key created for one workspace (from that workspace's settings, or with a `workspaceIds` grant) is **confined** to it. A request for another workspace is refused with `403`. ## Using a key Pass it as a Bearer token: ```bash curl https://pod.example.com/api/hub/entities \ -H "Authorization: Bearer synap_user_..." ``` A key works on the Hub REST API, MCP and the other doors its scopes name. It does not work on `/trpc`, the endpoint the SDK calls: that endpoint accepts only a sign-in session. See [SDK first query](/docs/build/sdk). ## Seeing and revoking keys **My connections** (in the pod admin console's account menu) lists the keys you hold **and the keys your agents and apps hold for you**, and you can revoke either kind there. Each key shows what it may touch, e.g. "Read Portfolios, Documents · 1 Space". Revoking takes effect immediately: in-flight requests with that key get `401`. ## Security notes - Keys are hashed at rest. The pod never stores the plaintext. - An AI agent's key cannot mint keys for other agents, widen its own approval rules, or grant itself vault access. Those requests are refused or become proposals you approve. - Keep keys in environment variables, one key per integration, with the smallest grant that works. ## Next steps - [Hub REST API reference](/docs/reference/hub-api): every route a key can call - [Scripts and agents with an API key](/docs/build/sdk#scripts-and-agents-with-an-api-key): the TypeScript client - [Webhooks](/docs/build/webhooks) - [Connect your AI](/docs/agents) # Build a website on your pod > Pick how your site talks to a pod, then build a Next.js app that people connect to their own pod, reading and writing their records with the SDK. URL: https://doc.synap.live/docs/build/build-a-website · Last reviewed against the code: 2026-11-03 A pod is a backend: a website or an app can read and write its records through the same doors, permissions and governance as the Synap apps. ## Pick how your site connects | Your site | Use | Credential | |---|---|---| | Shows what you published from your pod (a share, a form, a project published as a site) to anyone | `@synap-core/sdk/public` | None: the public token of what you published | | Lets each visitor connect **their own** pod and work on their records | `@synap-core/sdk/connect` (this tutorial) | The visitor's consent; the token stays on your server | | Runs on your own server against your own pod (a portfolio, an internal tool) | [`@synap-core/hub-rest-client`](/docs/build/sdk#scripts-and-agents-with-an-api-key) | An [API key](/docs/build/api-keys) kept on the server | | Runs where the person is already signed in to the pod (same domain) | The typed client in [`@synap-core/sdk`](/docs/build/sdk) | The person's sign-in session | Never put an API key in code that runs in the browser. ## Build an app people connect to their pod You will build a small notes app. A visitor enters their pod's address; their pod shows a consent screen that lists what the app asks for and lets them choose which spaces it may use; the app then lists their notes and creates new ones. `@synap-core/sdk/connect` handles the sign-in for you: the OAuth flow with PKCE, the checks on the pod's answers, the token kept in a sealed, HTTP-only cookie on your server, and its renewal. It is server-only and throws if it is loaded in a browser. It uses Web-standard `Request` and `Response`, so it works in Next.js route handlers and other frameworks; this tutorial uses the Next.js App Router. ### What you need - A Next.js 16 app (Next.js 16 names its middleware `proxy.ts`). - An https address for it, for example `https://notes.example.com`. A real pod only accepts an app served over https; in development, use a tunnel. - A pod to connect to, [hosted](/docs/start/cloud-quickstart) or [self-hosted](/docs/start/self-host-quickstart). ### Install the SDK and set two variables ```bash npm install @synap-core/sdk ``` ```bash title=".env.local" SYNAP_APP_URL=https://notes.example.com SYNAP_APP_SESSION_SECRET= ``` `SYNAP_APP_URL` is your app's origin: no path, no trailing slash, a domain name rather than an IP address. `SYNAP_APP_SESSION_SECRET` seals the cookie that holds the connection. Keep both server-side, never in a `NEXT_PUBLIC_` variable. ### Describe your app ```ts title="lib/synap.ts" import { createPodAppAuth } from "@synap-core/sdk/connect"; export const synap = createPodAppAuth({ appUrl: process.env.SYNAP_APP_URL!, clientName: "My notes", requests: [ { permission: "entity.note.read", reason: "Show your notes" }, { permission: "entity.note.create", reason: "Save the notes you write here" }, ], secret: process.env.SYNAP_APP_SESSION_SECRET!, }); ``` Each request is one permission, written `..` as in [API key grants](/docs/build/api-keys#grants-what-a-key-may-touch), with the sentence the consent screen shows. Ask for exactly what the app does: wildcards are refused, and the person sees every line. The SDK refuses at startup what the pod would refuse at sign-in. ### Mount the sign-in routes Each route file re-exports one handler: ```ts title="app/.well-known/synap-client.json/route.ts" import { synap } from "@/lib/synap"; export const GET = synap.handlers.clientMetadata; ``` ```ts title="app/api/synap/connect/route.ts" import { synap } from "@/lib/synap"; export const POST = synap.handlers.connect; ``` ```ts title="app/api/synap/callback/route.ts" import { synap } from "@/lib/synap"; export const GET = synap.handlers.callback; ``` ```ts title="app/api/synap/disconnect/route.ts" import { synap } from "@/lib/synap"; export const POST = synap.handlers.disconnect; ``` `/.well-known/synap-client.json` describes your app to the pod. Its URL is your app's client ID, so there is nothing to register on the pod beforehand. `connect` and `disconnect` accept only a `POST` from your own pages. ### Renew the connection before each page A server component cannot set cookies, so the connection is renewed in `proxy.ts`, before the page renders: ```ts title="proxy.ts" import { NextResponse, type NextRequest } from "next/server"; import { synap } from "@/lib/synap"; export async function proxy(request: NextRequest) { const outcome = await synap.refreshIfNeeded(request); const headers = new Headers(request.headers); if (outcome.cookieHeader !== null) headers.set("cookie", outcome.cookieHeader); const response = NextResponse.next({ request: { headers } }); for (const cookie of outcome.setCookies) response.headers.append("Set-Cookie", cookie); return response; } export const config = { matcher: [ { source: "/((?!_next/static|_next/image|api/synap/|\\.well-known/|.*\\.\\w+$).*)", missing: [ { type: "header", key: "next-router-prefetch" }, { type: "header", key: "purpose", value: "prefetch" }, ], }, ], }; ``` `refreshIfNeeded` renews the token only in its last five minutes. Forwarding `cookieHeader` lets the page see the renewed token in the same request. The matcher skips static files, the sign-in routes and router prefetches. ### Add a connect page ```tsx title="app/connect/page.tsx" export default function ConnectPage() { return (
); } ``` The form posts the pod's address (`https://` is added when it is missing). The visitor goes to their pod, approves, and comes back to `/`. A sign-in that fails comes back with an `error` code in the query: on `/connect` when it could not start, on `/connect/result` when it failed on the way back.
### Read the visitor's notes ```tsx title="app/page.tsx" import { headers } from "next/headers"; import { redirect } from "next/navigation"; import { synap } from "@/lib/synap"; import { addNote } from "./actions"; export default async function Home() { const connection = await synap.readConnection((await headers()).get("cookie")); if (!connection) redirect("/connect"); const pod = synap.client(connection); const notes = await pod.listEntities({ profileSlug: "note", limit: 50 }); if (!notes.ok) return

Could not read your notes ({notes.error.code}).

; return (
    {notes.data.map((note) => (
  • {note.title}
  • ))}
); } ``` Calls return a result instead of throwing: `{ ok: true, data }`, or `{ ok: false, error }` whose `error.code` says what happened, such as `expired` (connect again), `forbidden` (the person did not grant it), `rate_limited` or `pod_unreachable`. The app sees only the spaces the person chose; without `workspaceId`, `listEntities` reads all of them.
### Write, and expect a proposal ```ts title="app/actions.ts" "use server"; import { headers } from "next/headers"; import { redirect } from "next/navigation"; import { synap } from "@/lib/synap"; export async function addNote(form: FormData) { const connection = await synap.readConnection((await headers()).get("cookie")); if (!connection) redirect("/connect"); const pod = synap.client(connection); const space = pod.spaces()[0]; // a space the person granted if (!space) redirect("/connect"); const result = await pod.post("/entities", { profileSlug: "note", title: String(form.get("title")), workspaceId: space.workspaceId, }); if (!result.ok) redirect(`/?failed=${result.error.code}`); if (result.status === "proposed") redirect(`/?review=${encodeURIComponent(result.reviewUrl)}`); redirect("/?saved=1"); } ``` Every create names a space the person granted. A connected app acts as its own agent, one that asks first, so its writes come back as `status: "proposed"` with a `reviewUrl`, and the person approves them in their pod. That is a success: show "Sent to your pod for review" with the link, and never retry it. (`pod.actsAs` is `"agent"` for every app except Synap's official ones, whose writes apply directly.)
### Test without a pod `@synap-core/sdk/testing` has a mock pod, `createMockAuthServer()`, for development and tests. With `allowInsecureLoopback: true`, `createPodAppAuth` accepts it on `http://localhost`; a real pod, even a local one, still needs your app on https. ### Going further The connection client has typed reads beyond `listEntities`: `getEntity`, `getEntityConnections`, `getDocument`, `getFileUrl` (a signed link to a file) and `listPendingProposals` (what waits for the person's review; needs `proposal.read`). `spaces()` and `can(permission, workspaceId)` let a page adapt to what was granted. `pod.actions` asks the person's own tools to do something for them, such as publishing a post, after they approve it (needs `capability..run`). [Pod-app sign-in](/docs/build/pod-app-sign-in) is the reference for every option, result and error code, and the `AGENTS.md` file shipped in the npm package documents every rule. ## A public site To show what you published from your pod, with no sign-in at all: ```ts import { createPublicClient } from "@synap-core/sdk/public"; const pod = createPublicClient({ podUrl: "https://pod.example.com" }); const page = await pod.listCollection("", ""); if (page.ok) console.log(page.data); ``` The client reads a public share (`readShare`), a form (`getForm`, `submitForm`), or a project you published as a site (`getSite`, `listCollection`, `getRecord`). Publishing a site creates its token, shown once to the person who publishes it. The same entry has helpers that turn what it reads into safe page models: render pod content through them, never as raw HTML. ## Related - [Pod-app sign-in](/docs/build/pod-app-sign-in) - [SDK first query](/docs/build/sdk) - [Hub REST API reference](/docs/reference/hub-api) - [API keys](/docs/build/api-keys) - [Webhooks](/docs/build/webhooks) - [Run your own code](/docs/customize/runnable-code) # Chat stream > Stream an AI conversation backed by your pod, from any script or app, with one API key. URL: https://doc.synap.live/docs/build/chat-stream · Last reviewed against the code: 2026-10-20 `POST /api/external/chat/stream` sends a message to your pod's AI and streams the answer back as Server-Sent Events. The pod forwards the conversation to its **Intelligence Service** and records every turn. It needs an Intelligence Service configured on the pod: on Synap Cloud it is; on a self-hosted pod see [Self-hosted pod or Synap Cloud](/docs/use/cloud-vs-self-hosted#what-you-take-on-when-you-self-host). To connect your own agent to your pod instead, use [MCP](/docs/agents/mcp). ## Before you start Create an [API key](/docs/build/api-keys) with the `chat.stream` scope. ## List the channels you can chat in ```bash curl https://pod.example.com/api/external/chat/channels \ -H "Authorization: Bearer $SYNAP_API_KEY" ``` ## Send a message ```bash curl -N -X POST https://pod.example.com/api/external/chat/stream \ -H "Authorization: Bearer $SYNAP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": "What did I decide about the launch date?" }' ``` | Field | Required | Meaning | |---|---|---| | `query` | yes | Your message. | | `channelId` | no | A channel from `/channels`. Without it, your personal AI channel is used. | | `workspaceId` | no | The workspace to work in. | | `agentType` | no | Which agent should answer. | | `requestId` | no | A UUID you choose, to make a retry idempotent. Also accepted as the `X-Request-Id` header. | ## The response The response is `text/event-stream`. Every turn is recorded on the pod: - The `X-Synap-Turn-Id` response header carries the turn's ID. - The first frame is always the turn frame: ``` data: {"type":"turn","turnId":"…","requestId":"…"} ``` - The frames after it are the Intelligence Service's own stream, passed through unchanged. Their format is not documented here yet. If the Intelligence Service cannot be reached or fails, the endpoint answers `502` with a JSON body `{ "error": "…", "turnId": "…" }` instead of a stream. Service URLs and keys are never included in a response. ## Approving what the AI proposes When the AI wants to make a change that the pod's governance does not let it apply directly (under the default write mode: a deletion or a structural change), the change becomes a **proposal**. A person approves it, for example in the Browser app, or through the Hub REST API: ```bash curl -X POST https://pod.example.com/api/hub/proposals//approve \ -H "Authorization: Bearer $SYNAP_API_KEY" ``` This needs a key with `hub-protocol.write` that belongs to a person. An agent's key is always refused here: approving is a human step. `POST /api/hub/proposals//reject` rejects a proposal, and `GET /api/hub/proposals` lists them. # Coding with agents > Point Claude Code, Cursor and other coding agents at these docs, and connect them to your pod. URL: https://doc.synap.live/docs/build/coding-with-agents · Last reviewed against the code: 2026-10-20 A coding agent can connect to two different things. They are separate, and you can give it both. | | What the agent gets | Address | |---|---|---| | **These docs** | The documentation, to read and search while it writes code | `https://doc.synap.live/llms.txt`, any page as `.md`, the docs MCP server at `/api/mcp` | | **Your pod** | Your data, under the agent's own key and governance | Your pod's `/mcp`, connected with `@synap-core/cli` | Give it the docs when it writes code against Synap (an app on the SDK, a script on the Hub REST API, an MCP client). Connect it to your pod when it should work with your data. ## Give an agent these docs ### Start from llms.txt [`/llms.txt`](https://doc.synap.live/llms.txt) is the entry point written for agents: the sections, the key pages, the interfaces to prefer, and the package names that are retired and must not be used. [`/llms-full.txt`](https://doc.synap.live/llms-full.txt) is every page in one file. To make an agent use them in a repository, say so in its instruction file (`CLAUDE.md`, `AGENTS.md` or a Cursor rule): ```md Synap documentation: https://doc.synap.live/llms.txt Read a page as Markdown by adding .md to its URL. ``` ### Every page as Markdown Each page has a Markdown version, built from the same source as the HTML: ```bash curl https://doc.synap.live/docs/agents/mcp.md # add .md to the URL curl -H 'Accept: text/markdown' https://doc.synap.live/docs/agents/mcp # or ask for Markdown ``` On every page, **Copy Markdown** copies it, and **Open** sends it to ChatGPT, Claude or Cursor, or shows it on GitHub. ### The docs MCP server `https://doc.synap.live/api/mcp` is an MCP server (Streamable HTTP, no sign-in) with three tools: | Tool | Does | |---|---| | `list_pages` | The index of every page, with its URL | | `get_page` | One page as Markdown, by its URL (for example `/docs/build/sdk`) | | `search` | Full-text search over the docs | Claude Code: ```bash claude mcp add --transport http synap-docs https://doc.synap.live/api/mcp ``` Cursor, in `~/.cursor/mcp.json` or a project's `.cursor/mcp.json`: ```json { "mcpServers": { "synap-docs": { "url": "https://doc.synap.live/api/mcp" } } } ``` This server only serves the public documentation. It cannot see a pod. ## Connect an agent to your pod Every pod serves its own MCP server at `/mcp`. The CLI connects an agent to it with an identity and a key of its own, so its writes go through your pod's governance and you can revoke it separately. See [Connect your AI](/docs/agents) for every client. ```bash npx @synap-core/cli init # first time: finds or creates your pod and connects the agents it detects synap connect claude-code # or: codex, cursor, claude-desktop, ... ``` - **Claude Code**: `synap connect claude-code` registers the pod's MCP server with `claude mcp add` (user scope) and installs the [Synap skills](/docs/agents/skills) in `~/.claude/skills/`. - **Cursor**: `synap connect cursor` writes the pod's MCP server into `~/.cursor/mcp.json`. - **claude.ai** (web): its connector settings take a URL and sign you in with OAuth, with no key to paste. `synap mcp connect-claude` prints the steps and the Synap Cloud URL, `https://mcp.synap.live`. After you approve, ask Claude to list your pods (`list_pods`) and connect one (`connect_pod`). Check the connection with `synap mcp verify` and `synap whoami`. ### What the agent sees - Tool names start with `synap_`. A new agent key lists a small entry set: `synap_orient` is the session briefing (what awaits your review, open work, your identity and projects), and `synap_ask` answers questions from your data. The agent loads more tools in groups. [MCP tools](/docs/reference/mcp-tools) lists them all. - Its writes follow the write mode you chose when you connected it. Under the default, creates and edits apply directly with Undo, and deletions and structural changes become proposals you approve. It can never approve a proposal. See [Validation policy](/docs/concepts/validation-policy). - What it may read and change is set by its key: see [API keys](/docs/build/api-keys). ## Both at once The docs MCP server and your pod's MCP server are separate entries in the client's configuration: for example `synap-docs`, and the `synap-` entry that `synap connect` writes. An agent building on Synap uses the first to look up how, and the second to act on your data. # Build on Synap > The doors into a Synap pod, and which one to use for an app, a script, an integration or an agent. URL: https://doc.synap.live/docs/build · Last reviewed against the code: 2026-10-20 A pod is a backend first. Everything the apps do goes through the same doors you can use: the same records, the same permissions and the same governance. An agent or an app that writes through any door gets the same proposal and approval rules. This section is for developers: apps, scripts and integrations that read and write a pod. To connect an AI client such as Claude Code or Cursor, see [Connect your AI](/docs/agents) instead. ## In this section ### Apps and scripts ### With other tools ## The doors | Door | Path on the pod | Use it for | Auth | |---|---|---|---| | **tRPC API**, through the SDK | `/trpc` | TypeScript and React apps that act as a signed-in person | Sign-in session (cookie or session token); no API keys | | **Hub REST API** | `/api/hub/*` | Scripts, agents, integrations in any language | API key (`hub-protocol.read` / `.write`) | | **MCP** | `/mcp` | AI clients: Claude Code, Codex, Cursor, ChatGPT and others | API key or OAuth | | **Webhooks** | your URL | Being told when something changes | HMAC signature | | **External chat** | `/api/external/chat/*` | Streaming an AI conversation backed by your pod | API key (`chat.stream`) | | **External skills** | `/api/external/skills/*` | Listing and invoking skills | API key (`skills.invoke`) | Every pod publishes the OpenAPI description of its Hub REST API at `/api/hub/openapi.json`. ## The packages | Package | What it is | |---|---| | [`@synap-core/sdk`](https://www.npmjs.com/package/@synap-core/sdk) | Typed tRPC client for apps where a person signs in. See [SDK](/docs/build/sdk). | | [`@synap-core/react`](https://www.npmjs.com/package/@synap-core/react) | React provider and hooks over the SDK (TanStack Query). | | [`@synap-core/hub-rest-client`](https://www.npmjs.com/package/@synap-core/hub-rest-client) | Zero-dependency client for the Hub REST API, for agents and scripts that hold an API key. | | [`@synap-core/sdk-realtime`](https://www.npmjs.com/package/@synap-core/sdk-realtime) | Socket.IO client for change notifications. | | [`@synap-core/api-types`](https://www.npmjs.com/package/@synap-core/api-types) | The pod's tRPC `AppRouter` type. | | [`@synap-core/types`](https://www.npmjs.com/package/@synap-core/types) | Domain types and schemas. | | [`@synap-core/cli`](https://www.npmjs.com/package/@synap-core/cli) | The user CLI: connects computers and agents to a pod. | ## Where to start - An app people connect to their own pod: [Build a website on your pod](/docs/build/build-a-website), then the [pod-app sign-in reference](/docs/build/pod-app-sign-in). - An app in TypeScript where a person signs in: [SDK first query](/docs/build/sdk). - A script, a site or an integration: an [API key](/docs/build/api-keys) and the [Hub REST API](/docs/reference/hub-api). - React to changes in another system: [Webhooks](/docs/build/webhooks). - A coding agent that writes code against Synap: [Coding with agents](/docs/build/coding-with-agents). - An AI agent: [Connect your AI](/docs/agents), then [MCP](/docs/agents/mcp) and [agent skills](/docs/agents/skills). - How the data model works: [Kind and facets](/docs/concepts/kind-and-facets). # n8n > Connect n8n workflows to a pod with an API key, a webhook subscription and the Hub REST API. URL: https://doc.synap.live/docs/build/n8n · Last reviewed against the code: 2026-10-20 There is no Synap node for n8n. You connect a workflow to a pod with n8n's built-in **Webhook** trigger and **HTTP Request** nodes, the pod's [Hub REST API](/docs/reference/hub-api) and an [API key](/docs/build/api-keys). Use the Hub REST API (`/api/hub/*`) from n8n, not the pod's `/trpc` endpoint. In the examples, `https://pod.example.com` is your pod and `$SYNAP_API_KEY` is the key. ## 1. Create a key for n8n In the pod's admin console, open **Keys**, create a key named after the workflow (for example "n8n"), and give it the scopes `hub-protocol.read` and `hub-protocol.write`. Narrow its grant to what the workflow touches; see [Grants](/docs/build/api-keys#grants-what-a-key-may-touch). Copy the key: it is shown once. In n8n, store it as a header credential, so every HTTP Request node sends: ```http Authorization: Bearer ``` ## 2. Receive the pod's events in n8n Add a **Webhook** trigger node to the workflow with the `POST` method, and copy its production URL. Then subscribe that URL to the events you want, with the key: ```bash curl -X POST https://pod.example.com/api/hub/webhooks \ -H "Authorization: Bearer $SYNAP_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://n8n.example.com/webhook/synap", "eventTypes": ["entity.create.completed"]}' ``` The answer (`201`) holds the subscription's `id` and its `secret`. The secret is returned only here: keep it if you want to verify signatures. Pick event types from the [event catalog](/docs/reference/events#catalog). Each event arrives as a `POST` with a JSON body (`type`, `subjectId`, `userId`, `data`, `timestamp`) and the headers described in [Webhooks](/docs/build/webhooks#what-your-endpoint-receives). To check `X-Synap-Signature` in the workflow, compute the HMAC over the raw request body, as shown in [Verify the signature](/docs/build/webhooks#verify-the-signature). A failed delivery is retried with the same `X-Synap-Delivery-Id`; use it to skip duplicates. A subscription created with a key belongs to that key: - it delivers only the events the key's grant can read, and only while the key is valid; revoking or expiring the key stops it; - the key lists (`GET /api/hub/webhooks`) and deletes (`DELETE /api/hub/webhooks/`) only its own subscriptions. ## 3. Write to the pod from n8n Add an **HTTP Request** node that sends `POST https://pod.example.com/api/hub/entities` with a JSON body: ```json { "profileSlug": "note", "title": "Weekly report", "content": "Generated by n8n.", "source": "n8n" } ``` `title` is required. `profileSlug` is the kind (`note`, `task`, …). `content` is a long Markdown body, stored as a linked document. Writes go through the pod's governance, so handle both answers: | Status | Meaning | |---|---| | `200` | The entity was created. | | `202` | It became a proposal for a person to approve: `{ status: "proposed", proposalId, reviewUrl }`. | | `409` | An entity of the same kind with this title already exists. | Send an `Idempotency-Key` header (for example the n8n execution ID) so that a retried node does not create a second entity. ## 4. Read from the pod ```http GET https://pod.example.com/api/hub/entities?profileSlug=task&limit=20 ``` `q` searches instead of listing. Every endpoint, with its parameters and answers, is in the [Hub REST API reference](/docs/reference/hub-api). A key whose grant is narrower than `*` cannot use every read endpoint; see [Doors a scoped key can read through](/docs/build/api-keys#doors-a-scoped-key-can-read-through). # Pod-app sign-in > Reference for @synap-core/sdk/connect: the options, routes, permissions, connection life, client results and error codes of an app that people sign in to with their own pod. URL: https://doc.synap.live/docs/build/pod-app-sign-in · Last reviewed against the code: 2026-11-05 `@synap-core/sdk/connect` lets one app work on many pods: each person signs in with their own pod, chooses the spaces the app may use, and can take that access back. The app is an OAuth 2.1 public client of each pod (PKCE S256, the pod's `iss` checked on every answer). Its client ID is the https URL of a client metadata document that the app serves itself, so there is nothing to register on a pod. The pod's token stays on your server, sealed in an HTTP-only cookie; the browser never sees it. This page is the reference. To build an app step by step, follow [Build a website on your pod](/docs/build/build-a-website). The `AGENTS.md` file shipped in the npm package has every rule in full. The entry is server-only: it throws when loaded in a browser, and a browser bundle resolves it to a stub that throws. It uses Web-standard `Request`, `Response` and WebCrypto, so it runs in Next.js route handlers and `proxy.ts`, Hono, Remix and edge runtimes. It needs Node.js 20 or later. ## Set up: `createPodAppAuth` ```ts title="lib/synap.ts" import { createPodAppAuth } from "@synap-core/sdk/connect"; export const synap = createPodAppAuth({ appUrl: process.env.SYNAP_APP_URL!, // https://notes.example.com clientName: "Notes", requests: [ { permission: "entity.note.read", reason: "Show your notes" }, { permission: "entity.note.create", reason: "Save the notes you write here" }, ], secret: process.env.SYNAP_APP_SESSION_SECRET!, }); ``` | Option | What it is | |---|---| | `appUrl` | Your app's origin: https, a domain name (not an IP address), no path, query or fragment. `http://localhost` is accepted, but only the SDK's mock pod signs in an app served over http. | | `clientName` | The name the consent screen shows, 1 to 100 characters. | | `requests` | What the app asks for: 1 to 48 entries (duplicates count), each `{ permission, reason, scope? }`. See [Permissions](#permissions). | | `secret` | Seals the cookies. At least 32 characters, server-side only. Pass several to rotate. | | `templates` | Optional. Up to 8 template slugs the consent screen may offer to create as a space. | | `paths` | Optional. Overrides for the routes below. Each is an absolute path on your app. | | `store` | Optional. Where the connection is kept. Default: the sealed cookie. See [Your own store](#your-own-store). | | `resource` | Optional. `"api/hub"` (default), `"mcp"` or `null`: the pod API the token is for. | | `cloudUrl` | Optional. The Synap Cloud URL, to offer "Continue with Synap Cloud". See [Synap Cloud](#synap-cloud). | | `allowInsecureLoopback` | Optional. Accept a pod, or a Synap Cloud, served on `http://localhost`, for development. | | `onError` | Optional. Called with each refused sign-in, for your logs. Default: `console.warn`. Messages never carry a token. | | `fetch` | Optional. Your own `fetch`. | `createPodAppAuth` refuses at startup, with a `ConnectError` whose code is `misconfigured`, every setup the pod would refuse at sign-in, so the mistake shows when your app starts, not when a person connects. The client metadata document must stay under 8 KB. ## Routes | Path (default) | Method | Handler | What it does | |---|---|---|---| | `/.well-known/synap-client.json` | GET | `handlers.clientMetadata` | Serves the client metadata document. Its URL is the client ID. | | `/api/synap/connect` | POST | `handlers.connect` | Starts the sign-in for the pod named in the form. | | `/api/synap/callback` | GET | `handlers.callback` | Takes the pod's answer, stores the connection, redirects to `next`. | | `/api/synap/disconnect` | POST | `handlers.disconnect` | Revokes the token at the pod and clears the cookie. | | `/api/synap/cloud` | POST, GET | `handlers.cloudConnect`, `handlers.cloudReturn` | Synap Cloud sign-in, when `cloudUrl` is set. | Three more paths are pages of your app: `/connect` (the connect page; the pod may send people there to start a sign-in), `/connect/result` (where a failed callback lands with `?error=`) and `/` (where a sign-in lands when it named no `next`). Each route file re-exports one handler, for example `export const POST = synap.handlers.connect;`. `connect` and `disconnect` change state, so they accept a `POST` from your own pages only (the `Origin` header, or `Sec-Fetch-Site: same-origin`). The connect form sends: | Field | Meaning | |---|---| | `pod` | The pod's address, as the person typed it. `https://` is added when it is missing. | | `next` | Optional. A path on your app to land on after sign-in. | | `space` | Optional. A space to suggest on the consent screen. A pod may ignore it: never rely on a space being preselected. | | `prompt` | Optional. `consent` shows the consent screen again even when this browser is already connected (to widen or narrow access); `login` asks the person to sign in to the pod again. | Before it sends the browser anywhere, the SDK reads the pod's OAuth metadata and checks that it is a Synap pod that supports app sign-in. It never follows a redirect from the pod: a pod that moved answers `pod_moved`, and the person connects again with the new address. The connect route fetches an address a visitor typed, so rate-limit it per visitor. ## Permissions Each request names one permission in the pod's grammar, `[.].`, lowercase, as in [API key grants](/docs/build/api-keys), and the sentence the consent screen shows (`reason`, 1 to 200 characters). The person ticks what the app gets; asking is not getting. | Rule | Example | |---|---| | No wildcard: name what you ask for. | `entity.note.read`, not `entity.*` | | A subject and at least one more segment. | `entity.note` (every action on notes) is accepted; `document` alone is not. | | A qualifier only on `entity` (a kind), `capability` (an intent) and `event` (a family). | `entity.post.create`, `capability.publish_post.run`, `event.dev.read` | | On an intent, `run` is the only action. | `capability.send_message.run` | | `scope: "pod"` only on a read of one kind. Everything else is given per space. | `{ permission: "entity.decision.read", reason, scope: "pod" }` | A pod-wide read comes back as a grant row with no space: `listEntities({ profileSlug })` with no `workspaceId` then lists that kind across the pod. Writes always name a space the person granted. ## The connection After sign-in the connection holds the pod's URL, the person (`user`), the grant by space and the tokens. | | | |---|---| | Access token | Lives 1 hour. | | Refresh token | Rotates on each use and lives 30 days from issue. A spent refresh token presented again within a short grace (30 seconds by default) gets the same new pair; after it, the pod revokes the whole connection. | | Session cookie | `__Host-synap_session` on https, sealed with AES-GCM. | | Marker cookie | `__Host-synap_seen`, 400 days: the pod's URL only, so a lapsed connection reads as "expired", not "never connected". A disconnect clears it. | Read the connection where you have the request, or its `Cookie` header: ```ts const connection = await synap.readConnection((await headers()).get("cookie")); if (!connection) redirect("/connect"); ``` `synap.readLapsed(cookieHeader)` answers `{ podUrl }` when this browser was connected to a pod and the connection lapsed, so you can say "expired, connect again" with the address pre-filled. ### Renewal A server component cannot set cookies, so renew in `proxy.ts` (or a route handler) before the page renders: `synap.refreshIfNeeded(request)` rotates the token only in its last 5 minutes, and only once at a time per connection in the process. Send `outcome.setCookies` on the response and forward `outcome.cookieHeader` as the request's `Cookie`. [Build a website on your pod](/docs/build/build-a-website) has the full `proxy.ts`, with the matcher that skips static files, the sign-in routes and router prefetches. | `status` | Meaning | |---|---| | `none` | No connection in this request (`lapsed` set when there was one). | | `skipped` | A prefetch or a static asset: nothing renewed. | | `fresh` | Valid beyond the renewal window, or no refresh token. | | `refreshed` | Rotated: send `setCookies`, forward `cookieHeader`. | | `kept` | The refresh failed but the access token still works. Not asked again for a minute. | | `expired` | The access token is spent and cannot be renewed: connect again. | | `revoked` | The pod refused the refresh token (access removed): connect again. | | `unavailable` | The pod could not be reached and the access token is spent: try later. | In a route handler or a server action, `synap.client(connection, { request, persist })` renews once after a `401` and retries the request once; `persist` receives the `Set-Cookie` values to send. Without `persist` (a server component), a `401` answers `unauthorized` with `refreshable: true`: send the visitor through the proxy with `refreshIfNeeded(request, { force: true })`. ## The client: `synap.client(connection)` ```ts const pod = synap.client(connection); const notes = await pod.listEntities({ workspaceId, profileSlug: "note", limit: 50 }); if (!notes.ok) console.warn(notes.error.code); const res = await pod.post("/entities", { profileSlug: "note", workspaceId, title: "Hello" }); if (res.ok && res.status === "proposed") showPending(res.reviewUrl); ``` Calls never throw: a read answers `{ ok: true, data }` or `{ ok: false, error }`. A write answers one of: | Result | Meaning | |---|---| | `{ ok: true, status: "applied", data }` | The pod applied the write. | | `{ ok: true, status: "proposed", proposalId, reviewUrl, data }` | The write waits for the person's review. This is a success: show `reviewUrl`, never retry. | | `{ ok: false, error }` | Refused or failed; see [Error codes](#error-codes). | `get`, `post`, `patch`, `put` and `delete` take a Hub REST path (`/entities`, not `/api/hub/entities`); see the [Hub REST API](/docs/reference/hub-api). Encode each path segment with `encodeURIComponent`: a path that could leave the Hub answers `invalid` without a request. Typed reads include `listEntities`, `getEntity`, `getEntityConnections`, `getDocument`, `getFileUrl` and `listPendingProposals` (needs `proposal.read`). | Member | What it tells you | |---|---| | `actsAs` | `"agent"` for every app except Synap's official ones (`"person"`). An agent's writes are proposals, and an agent never approves. | | `spaces()` | The granted spaces: `{ workspaceId, workspaceName, permissions }`, plus `templateSlug` when the pod names the template the space came from. | | `podWide()` | The reads approved pod-wide. | | `can(permission, workspaceId?)` | Whether the grant covers a permission, read with the pod's grammar (`entity.read` covers `entity.note.read`). | | `reach(permission)` | Where the connection holds it: `{ kind: "pod" }`, `{ kind: "spaces", ids }` or `null`. | | `rateLimit()` | The budget the pod's last answer named: `{ limit, remaining, resetSec, at }`, or `null`. | | `actions` | `actions.list` and `actions.request`: ask the person's own tools to do something (needs `capability..run`). An intent that reaches outside the pod, such as posting or sending a message, always comes back `proposed`. | Client options: `timeoutMs` (default 10 000; a slower request answers `pod_unreachable`), `maxResponseBytes` (default 8 MiB; a bigger answer is `server`) and `retryRateLimitedWithinSec` (default 0: a `GET` answered `429` with a wait at most this long is asked once more after the wait; writes are never retried). ### Rate limits A pod budgets the calls each connection makes in a 15-minute window, with separate budgets for reads and writes (by default 3,000 reads and 500 writes; the pod's owner can change them). Over the budget, every call answers `rate_limited` with `retryAfterSec` until the window ends. Read a list once per page and keep it for that request, rather than asking again. ## Error codes A call's `error` is `{ code, status, retryAfterSec?, detail?, podCode?, reason? }`. Branch on `code`; `detail` and `podCode` are for your logs. `status` is `null` when nothing was answered, and `reason` is set when the SDK refused without sending anything (`not_granted`, `agent_cannot_approve`, `invalid_input`). `POD_ERROR_CODES` lists every code. | `code` | What to do | |---|---| | `expired` | The connection's time is up: connect again. | | `unauthorized` | The pod refused the token; with `refreshable`, renew once (see [Renewal](#renewal)). | | `forbidden` | The person did not grant this, or an agent tried to approve. | | `door_unsupported` | The pod is too old for this call. | | `not_found` | It does not exist, or the app cannot read it. | | `invalid` | The request is malformed. | | `conflict` | Someone changed it first: read again. | | `rate_limited` | Wait `retryAfterSec`. | | `pod_unreachable` | No answer, or a timeout: try later. | | `pod_moved` | The pod answered a redirect: connect again with its new address. | | `step_up_required` | The person must confirm at their pod first. | | `email_unverified` | Synap Cloud needs a verified email. | | `origin_insecure` | Synap Cloud needs the app on https. | | `server` | The pod failed, or answered something the SDK cannot read. | A sign-in that fails redirects with `?error=`: to your connect page when it could not start, to your result page when it failed on the way back. `parseConnectErrorCode(value)` reads it back (`null` for anything else). | Sign-in `error` | Meaning | |---|---| | `invalid_pod_address` | The address is not a usable URL. | | `not_a_pod` | Something answered, but it is not a Synap pod. | | `pod_unreachable` | The pod did not answer. | | `pod_unsupported` | A Synap pod too old for app sign-in. | | `cp_unavailable` | Synap Cloud is not configured for this app. | | `denied` | The person said no on the consent screen. | | `expired_transaction` | No sign-in in progress, or it is older than 10 minutes. | | `mismatch` | The answer does not belong to the sign-in this browser started. | | `misconfigured` | The app's own setup is wrong. | | `rate_limited` | The pod asked to slow down. | | `expired`, `revoked` | The connection lapsed, or the pod refused its refresh token. | | `pod_moved` | The pod moved: connect again with its new address. | | `server_error` | The pod answered something the SDK cannot use. | ## Synap Cloud With `cloudUrl` set, `synap.cloudConnectAvailable` is `true` and the app can offer "Continue with Synap Cloud": a `POST` to `handlers.cloudConnect` sends the browser to the Synap Cloud pod chooser, which returns to your connect page. There, `acceptLaunch(url, origin).cloudState` is set: forward the request's query to `handlers.cloudReturn`, which checks the return against this browser's cookie before the chosen pod is used, then signs in as with a typed address. ```tsx title="app/connect/page.tsx" const launch = acceptLaunch(url, origin); if (launch.cloudState) redirect(`${synap.paths.cloud}${new URL(url).search}`); ``` ## Your own store By default the connection lives in the sealed cookie. To keep it in a database or a key-value store, implement `ConnectionStore` and pass it as `store`: ```ts interface ConnectionStore { read(request: Request): Promise; write(connection: PodConnection, request: Request): Promise; // Set-Cookie values clear(request: Request): Promise; } ``` A shared server-side store also protects a connection served by several server instances: the pod revokes a connection when a spent refresh token is presented again, and only one store all instances read can rule that out. ## Test without a pod `@synap-core/sdk/testing` has `createMockAuthServer()`, a mock pod with the metadata, the consent step, the token, refresh and revoke endpoints and the Hub doors an app uses, and `createMockCloud()` for the Synap Cloud chooser. Pass the mock's `fetch` to `createPodAppAuth`; the mock answers in memory, so your app can run on `http://localhost`. A real pod, even a local one, accepts only an app served over https: use a tunnel in development. ```ts import { createMockAuthServer } from "@synap-core/sdk/testing"; const pod = createMockAuthServer({ actsAs: "agent" }); const synap = createPodAppAuth({ ...config, fetch: pod.fetch }); ``` ## Related - [Build a website on your pod](/docs/build/build-a-website) - [API keys](/docs/build/api-keys) - [Permission model](/docs/concepts/permission-model) - [Hub REST API](/docs/reference/hub-api) # SDK first query > Install the typed SDK, create a client for your pod and read your first entities. URL: https://doc.synap.live/docs/build/sdk · Last reviewed against the code: 2026-10-20 `@synap-core/sdk` is a typed tRPC client for a Synap pod. Every procedure the pod exposes is available with autocomplete and compile-time checks, because the client is typed with the pod's own router type. The SDK calls the pod's `/trpc` endpoint, which accepts only a **sign-in session**: a person's session cookie in the browser, or their session token anywhere else. It is for apps that act as a signed-in person. It does not take API keys: for a script, an integration or an agent that holds an API key, use the [Hub REST API](#scripts-and-agents-with-an-api-key) instead. ## What you need - A pod: [hosted](/docs/start/cloud-quickstart) or [self-hosted](/docs/start/self-host-quickstart). - An account on it you can sign in with. - The ID of the workspace you want to read. ## 1. Install ```bash npm install @synap-core/sdk ``` For a React app, install the React bindings instead; they include the SDK: ```bash npm install @synap-core/react ``` ## 2. Sign in and create a client In the browser, on a subdomain of the pod's domain (for example `app.example.com` next to `pod.example.com`) where the person is already signed in, pass no credential: every request is sent with `credentials: "include"`, so the browser's session cookie authenticates it. ```ts import { createSynapClient } from "@synap-core/sdk"; const synap = createSynapClient({ podUrl: "https://pod.example.com", // no trailing slash, no /trpc workspaceId, }); ``` Anywhere else (a server, a script, a desktop or mobile app), sign in once to get a session token, and pass it as `sessionToken`. A pod with password sign-in issues one through the native login flow of its sign-in service: ```bash FLOW=$(curl -fsS https://pod.example.com/.ory/kratos/public/self-service/login/api | jq -r .id) curl -fsS -X POST "https://pod.example.com/.ory/kratos/public/self-service/login?flow=$FLOW" \ -H "Content-Type: application/json" \ -d '{"method": "password", "identifier": "you@example.com", "password": ""}' \ | jq -r .session_token ``` ```ts const synap = createSynapClient({ podUrl: "https://pod.example.com", sessionToken: process.env.SYNAP_SESSION_TOKEN, workspaceId: process.env.SYNAP_WORKSPACE_ID!, onAuthError: () => { // 401: the session expired or was revoked. Sign in again. }, }); ``` A session lasts 30 days and is not extended by use; treat the token like a password. | Option | Meaning | |---|---| | `podUrl` | Base URL of the pod. The client calls `/trpc`. | | `sessionToken` | A sign-in session token, sent as `x-session-token`. Leave it out to use the browser's session cookie. | | `workspaceId` | Sent as `x-workspace-id` to scope requests. Pass `""` for procedures that need no workspace. | | `extraHeaders` | Added to every request. | | `onAuthError` | Called on `401`. The client then rejects with a clean tRPC error instead of a parse error. | The type also has an `apiKey` option. It is only for the desktop app's local pod; a pod refuses API keys (`synap_user_…`, `synap_hub_…`) on `/trpc` with `401`. Calls made in the same tick are batched into one HTTP request, and values are encoded with superjson, which is why plain HTTP clients should use the [Hub REST API](/docs/reference/hub-api) instead of `/trpc`. ## 3. Read entities ```ts const { items, pagination } = await synap.entities.list.query({ limit: 20 }); for (const entity of items) { console.log(entity.id, entity.title); } ``` `entities.list` takes `limit` (1 to 1000, default 50) and `offset`, and filters such as `profileSlug` (one kind, for example `"task"`) and `facetSlug` (one role). With a workspace set, it returns that workspace's entities. ## 4. Write, and expect proposals ```ts const result = await synap.entities.create.mutate({ profileSlug: "note", title: "My first note", }); ``` Writes go through the pod's governance. Depending on the pod's rules, a write is applied or comes back as a **proposal** (`status: "proposed"` with a `proposalId`) that a person approves. Handle both. See [Validation policy](/docs/concepts/validation-policy). ## React ```tsx import { SynapProvider, useSynap } from "@synap-core/react"; export function App() { return ( ); } function Entities() { const { data } = useSynap.entities.list.useQuery({ limit: 20 }); return
    {data?.items.map((e) =>
  • {e.title}
  • )}
; } ``` `useSynap` is the tRPC React client itself, not a function: write `useSynap.entities.list.useQuery(…)`, not `useSynap()`. `SynapProvider` takes the same options as `createSynapClient` (here, the signed-in person's session cookie; pass `sessionToken` outside the browser), plus an optional `queryClient` to share an existing TanStack Query client. `@synap-core/react` also exports ready-made `RouterInputs` and `RouterOutputs` types, `useSynapContext` (the provider's `podUrl` and `workspaceId`), and the hooks `useEntity`, `useEntities`, `useLinks` and `useView`. ## Package reference | Package | Exports | |---|---| | `@synap-core/sdk` | `createSynapClient`, and the types `SynapClient`, `SynapClientOptions` and `AppRouter` | | `@synap-core/react` | `SynapProvider`, `useSynap`, `useSynapContext`, `useEntity`, `useEntities`, `useLinks`, `useView`, and the types `RouterInputs`, `RouterOutputs`, `SynapProviderProps`, `AppRouter` | Both packages ship ES modules and CommonJS with TypeScript declarations, under the MIT license. The router types come from `@synap-core/api-types`, a dependency, so the client's types follow the version of that package you install. `@synap-core/sdk` also publishes three subpaths: `./public` (read what a pod publishes, with no sign-in), `./connect` (a website or app a person connects to their pod, see [Build a website](/docs/build/build-a-website)) and `./testing` (a mock pod for tests). Anything not listed in the package's `exports` is internal. ## Scripts and agents with an API key An [API key](/docs/build/api-keys) works on the Hub REST API under `/api/hub`, not on `/trpc`. From TypeScript, [`@synap-core/hub-rest-client`](https://www.npmjs.com/package/@synap-core/hub-rest-client) is a zero-dependency client for it: ```bash npm install @synap-core/hub-rest-client ``` ```ts import { HubRestClient } from "@synap-core/hub-rest-client"; const hub = new HubRestClient({ podUrl: "https://pod.example.com", apiKey: process.env.SYNAP_API_KEY!, workspaceId: process.env.SYNAP_WORKSPACE_ID, }); const entities = await hub.getRecentEntities({ profileSlug: "task", limit: 20 }); ``` From any other language, call the same routes over HTTP with `Authorization: Bearer `: ```bash curl "https://pod.example.com/api/hub/entities?profileSlug=task&limit=20" \ -H "Authorization: Bearer $SYNAP_API_KEY" ``` Every route is in the [Hub REST API reference](/docs/reference/hub-api). # Skill invocation > List and invoke skills on your pod over HTTP with an API key. URL: https://doc.synap.live/docs/build/skill-invocation · Last reviewed against the code: 2026-11-04 The skills on this page are operations your pod runs, called over HTTP. They are not [agent skills](/docs/agents/skills), which are folders of instructions that teach an AI client how to use Synap. ## What it is A skill is a named operation stored on your pod, with an input schema. You call it like a typed function: you send `input` as JSON and get a JSON `result` back. No language model sits between you and the call. Use it from a script, a scheduled job or your own app when you want the same operation every time, under the permissions of the key that calls it. ## Get an API key Create an [API key](/docs/build/api-keys) with the scope `skills.invoke`. Give it full access: a key whose grant is limited to some kinds, spaces or objects is refused on these routes (`403 GRANT_DOOR_UNSUPPORTED`). The key is shown once, when you create it. ## List your skills ```bash curl https://pod.example.com/api/external/skills \ -H "Authorization: Bearer " ``` The answer is an array of the active skills the key's user can see. It also includes instruction skills (`kind: "instruction"`), which hold text for agents rather than an operation: ```json [ { "id": "0b6f1c9e-2d4a-4e8b-9c1a-5f3e7d2a1b00", "name": "Summarize overdue tasks", "description": "Returns a summary of the overdue tasks in a space.", "scope": "workspace", "parameters": { "type": "object", "properties": { "workspaceId": { "type": "string" } }, "required": ["workspaceId"] }, "executionMode": "sync", "timeoutSeconds": 30, "kind": "code" } ] ``` `parameters` is the JSON Schema of the skill's `input`. Call a skill by its `id`; its name is not accepted in the URL. ## Invoke a skill ```bash curl -X POST https://pod.example.com/api/external/skills//invoke \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "input": { "workspaceId": "" } }' ``` A skill that ran answers: ```json { "success": true, "result": { "…": "what the skill returned" }, "correlationId": "", "ackState": "applied" } ``` `result` is whatever the skill returns. `input` is optional; an empty body runs the skill with no input. ## Who can see a skill Each skill has a scope: | Scope | Who can list and invoke it | |-------|-----------| | `pod` | Every user of the pod | | `workspace` | Members of the skill's space | | `user` | Only the user who owns it | A key acts for a user (for an agent's key, the person the agent works for). A `user` skill that belongs to someone else, or a `workspace` skill in a space that user is not a member of, answers `404`, as if it did not exist. ## Governance An invocation goes through the same governance check as any other run of a skill. If the key belongs to an agent, the pod decides whether the run goes ahead, waits for a person, or is refused (see the [validation policy](/docs/concepts/validation-policy)). When the run needs a person's approval, nothing runs yet: the pod answers `202` with a proposal, and the skill runs when a person approves it. ```json { "success": false, "proposed": true, "proposalId": "", "reviewUrl": "" } ``` ## Errors and other answers | Status | Meaning | |--------|---------| | `200` with `success: false` | The skill ran and failed. The body has an `error` message. | | `202 Accepted` | Nothing ran yet: the run became a proposal (see above). | | `400 Bad Request` | The request body is invalid, or the skill exists but is not active. | | `401 Unauthorized` | The API key is missing, invalid or expired. | | `403 Forbidden` | The key lacks the `skills.invoke` scope, its grant is narrower than full access (`GRANT_DOOR_UNSUPPORTED`), its person is a guest of the pod, or the pod's governance refused the run. The `error` says which. | | `404 Not Found` | The skill does not exist, or the key's user cannot see it. | | `429 Too Many Requests` | The key's rate limit is reached. | | `502 Bad Gateway` | The pod could not execute the skill. | ## TypeScript example ```typescript const POD_URL = 'https://pod.example.com'; const API_KEY = process.env.SYNAP_API_KEY; async function invokeSkill(skillId: string, input: Record) { const res = await fetch(`${POD_URL}/api/external/skills/${skillId}/invoke`, { method: 'POST', headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ input }), }); if (res.status === 202) return { proposed: true, ...(await res.json()) }; if (!res.ok) throw new Error(`${res.status} ${await res.text()}`); const data = await res.json(); if (!data.success) throw new Error(`Skill failed: ${data.error}`); return data.result; } ``` ## Next steps - [API keys](/docs/build/api-keys) - [Chat stream](/docs/build/chat-stream) - [Validation policy](/docs/concepts/validation-policy) # Webhooks > Have your pod POST a signed request to your URL when something changes. URL: https://doc.synap.live/docs/build/webhooks · Last reviewed against the code: 2026-10-20 A webhook subscription tells your pod to send an HTTP `POST` to a URL you own whenever an event you chose happens: an entity was created, a proposal was approved, a document was updated, and so on. ## Create a subscription Webhooks are managed through the tRPC router `webhooks` (with the [SDK](/docs/build/sdk) or a signed-in session): ```ts const { subscription, secret } = await synap.webhooks.create.mutate({ name: "CRM sync", url: "https://example.com/hooks/synap", eventTypes: ["entity.create.completed", "proposal.approved.completed"], // secret: "…" optional; generated (32 random bytes, hex) when omitted }); ``` - `eventTypes` needs at least one event type. Pick them from the [event catalog](/docs/reference/events#catalog). - The `secret` is returned **once**, at creation. `webhooks.list` never returns it. Store it to verify signatures. - `webhooks.update` changes `name`, `url`, `eventTypes` or `active`; `webhooks.delete` removes the subscription. - A subscription created with `webhooks.createForWorkspace` receives only that workspace's events. The Hub REST API also exposes webhooks under `/api/hub/webhooks` for API-key callers. See the pod's `/api/hub/openapi.json` for the exact shapes. ## What your endpoint receives Most deliveries use the `event.v1` format: ```http POST /hooks/synap HTTP/1.1 Content-Type: application/json User-Agent: Synap-Webhook/1.0 X-Synap-Webhook-Format: event.v1 X-Synap-Delivery-Id: 6f1c… X-Synap-Event-Type: entity.create.completed X-Synap-Event-Id: X-Synap-Signature: { "type": "entity.create.completed", "subjectId": "…", "userId": "…", "data": { … }, "timestamp": "…" } ``` Chat events and entity property updates use the `chat.v1` format instead: body `{ event, data, timestamp }`, header `X-Synap-Event` instead of `X-Synap-Event-Type`, and the signature prefixed with `sha256=`. Read `X-Synap-Webhook-Format` to tell them apart. ## Verify the signature The signature is the HMAC-SHA256 of the raw request body, keyed with the subscription's secret, in hex. Compute it over the bytes you received, before parsing the JSON: ```ts import { createHmac, timingSafeEqual } from "node:crypto"; export function isValidSynapSignature(rawBody: Buffer, header: string | undefined, secret: string): boolean { if (!header) return false; const received = header.startsWith("sha256=") ? header.slice(7) : header; // chat.v1 adds the prefix const expected = createHmac("sha256", secret).update(rawBody).digest("hex"); return received.length === expected.length && timingSafeEqual(Buffer.from(received), Buffer.from(expected)); } ``` ## Retries and duplicates A delivery that fails is retried with backoff. Every retry sends the **same body** with the **same signature** and the same `X-Synap-Delivery-Id`, so use that ID to ignore a delivery you already processed. Answer with a `2xx` status quickly and do the work afterwards. ## Which events are sent The pod sends a webhook for each change recorded with a subject and an action, as `..completed`: `entity.create.completed`, `document.update.completed`, `proposal.approved.completed` and so on. The [event catalog](/docs/reference/events#catalog) lists the event types the pod defines. A subscription receives an event only if its type is listed in `eventTypes`. Changes that arrive through pod-to-pod sync are not sent again as webhooks. # Code of conduct > How we expect everyone to behave in Synap's repositories and community spaces, and how to report a problem. URL: https://doc.synap.live/docs/community/code-of-conduct · Last reviewed against the code: 2026-10-20 Synap's community spaces (the GitHub repositories, issues and pull requests, and the Discord server) follow the [Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). In short: - Be respectful and assume good faith. Disagree with ideas, not with people. - No harassment, insults, discriminatory language or unwelcome sexual attention, in public or in private. - Do not publish other people's private information without their permission. - Keep feedback specific and about the work. ## Reporting If someone's behaviour makes you uncomfortable, or you see a breach of this code, email **support@synap.live**. Reports are handled privately. Tell us what happened, where, and who was involved, with links if you have them. Maintainers may remove comments, commits or other contributions that break this code, and may ban people who break it repeatedly or seriously. This page is a draft: a `CODE_OF_CONDUCT.md` in each repository will become the canonical text. # Docs style guide > How to write a page for this site, the frontmatter every page needs, and how to verify what it says. URL: https://doc.synap.live/docs/community/docs-style-guide · Last reviewed against the code: 2026-10-20 This site is public and is read by people and by AI agents. A wrong page costs more than a missing one: an agent follows it literally. So every page states only what has been checked against the code. ## What belongs here | Kind of knowledge | Where it lives | |---|---| | How to use, self-host, build on or contribute to Synap | **This site** | | How one repository's code works: architecture, invariants, design decisions | That repository's `docs/` folder, reviewed with the code | | Company plans, strategy, research and internal notes | Not in a public repository | | Reference that can be generated (CLI, MCP tools, REST API, events) | Generated from the source repositories; never edited by hand here | ## Where a page goes Pages live in `content/docs/
/`. Pick the section by the reader's goal: | Section | For | |---|---| | `start` | Getting a first pod working: the quickstarts | | `concepts` | Understanding how Synap works, from the simplest idea to the most technical, and the glossary | | `use` | Using the apps day to day | | `agents` | Connecting an AI client: MCP and agent skills | | `build` | Building on a pod: SDK, keys, webhooks, the API doors | | `run` | Self-hosting and operating a pod | | `reference` | Lookup pages | | `community` | Contributing and policies | Add the page's file name (without extension) to the `pages` list of the folder's `meta.json`, or it will not appear in the navigation. Each section's `index.mdx` is its landing page: add a Card for the new page there too, in the same order as `meta.json` (`npm run check` fails otherwise). If you move a page, add a permanent redirect from its old URL in `next.config.mjs`. ## Frontmatter Every page starts with this block. The build fails on a page that does not match it, and `npm run check` reports the same errors without a build. ```yaml --- title: Webhooks # sentence case, short description: One sentence that says what the page gives the reader. type: how-to # tutorial | how-to | reference | explanation audience: builder # user | self-host | builder | contributor availability: [pod-oss, cloud] # one or more of: pod-oss, cloud, browser, relay, raycast, eve, cli, sdk status: current # current | beta | deprecated: the page's review state # maturity: beta # optional, the feature's state: beta | not-published | main-only owner: Antoinesrvt # GitHub handle of the person who keeps it right last_reviewed: 2026-10-20 # only if you verified the page against the code that day --- ``` - **type**, after the Diataxis framework: a *tutorial* teaches by doing, a *how-to* solves one task, a *reference* describes something to look up, an *explanation* gives understanding. One type per page. - **availability** is shown as badges: where the page's content applies. - **status** is the state of the page, not of the feature: `current` once the page is checked against the code, `beta` while it is not re-verified (it shows a warning banner and has no `last_reviewed`; `npm run check` refuses the two together), `deprecated` for something being retired. - **maturity** is the state of the feature the page describes, shown as a badge. Leave it out for a released feature. `beta` shows "Beta testing" (for example Relay, on TestFlight only), `not-published` shows "Not published yet" (built, but not where people install it, such as the Raycast Store), and `main-only` shows "Not in a release yet" (on a repository's main branch, not in a tagged release). When only one part of a page is unreleased, say so in that part instead. - **last_reviewed**: set it only when you checked every command, flag, path, name and number on the page against the code, and update it whenever you do so again. ## The verification rule Before you write a fact, find it in the code: - a command or flag: in the CLI's command definitions or `--help` output; - an endpoint, header or status code: in the route that serves it; - a package name: on npm (`npm view `) and in its `package.json`; - a setting: in `deploy/env.schema` of the backend repository; - a count ("13 tables", "29 event types"): count it in the code, or leave the number out. If you cannot verify something, leave it out, or keep the page `status: beta` without `last_reviewed`. Never copy a command from another doc without running it or reading its source. ## Writing - Plain, specific sentences. Say what the reader does and what happens. - Use "you" for the reader. Use the present tense. - One idea per paragraph. Tables for options and comparisons. - Code blocks for anything the reader types, with placeholders like `pod.example.com` and ``. - No marketing language, no emoji. - Use Synap's terms as the [glossary](/docs/concepts/glossary) defines them: kind, role (facet), project, track, session, playbook, proposal. - On pages for users (`audience: user`), name things with the word the apps show, as the glossary gives it: Space, Request, Job, Goal, Step, Tool. Keep the technical name (`workspaceId`, `focus_session`, a tool or field name) in code formatting, where the reader types or reads it in an API, the CLI or MCP. ## Links - Link to other pages with absolute paths: `/docs/build/api-keys`, not `./api-keys`. Relative links break when a page is an index page or moves. - `npm run check:links` checks every internal link and anchor. - Link to repositories, not to files that may not exist yet. ## Retired names Some package names and domains never existed or were retired; for example, the CLI is `@synap-core/cli` and nothing else. `npm run check:retired` fails on any of them. The list is `scripts/retired-names.json`. ## Before you open a pull request ```bash npm ci npm run check # frontmatter, links, retired names npm run build ``` The same checks run in CI on every pull request. # Community > The open-source Synap repositories, how to start contributing to each, and where to ask questions. URL: https://doc.synap.live/docs/community · Last reviewed against the code: 2026-10-20 Synap's pod and its command-line tool are open source under the MIT license, and this documentation is a public repository. Contributions are welcome in each of them. ## In this section ## The repositories | Repository | What it is | Start with | |---|---|---| | [Synap-core/backend](https://github.com/Synap-core/backend) | The pod: API, database schema, workers, MCP server, deploy tooling and the agent skills (`skills/`) | The repository's README and contributing guide | | [Synap-core/synap-cli](https://github.com/Synap-core/synap-cli) | `@synap-core/cli`, the user CLI that connects computers and agents to a pod | The repository's README and contributing guide | | [Synap-core/doc](https://github.com/Synap-core/doc) | This site | [Docs style guide](/docs/community/docs-style-guide) | Each repository's own contributing guide is the source of truth for how to build, test and submit changes there. Read it before opening a pull request: the pod repository in particular has architecture rules and checks that a pull request must pass. The SDK packages (`@synap-core/sdk`, `@synap-core/react`) are published on npm under the MIT license; their source repository is not public yet. ## Ways to contribute - **Report a bug** in the repository it belongs to, with the version (`synap status --json` for a pod, `synap --version` for the CLI) and the steps to reproduce it. - **Fix the docs.** Every page is a file under `content/docs/` in [Synap-core/doc](https://github.com/Synap-core/doc). See the [docs style guide](/docs/community/docs-style-guide). - **Improve a skill.** The agent skills live in `skills/` in the backend repository. See [Agent skills](/docs/agents/skills). - **Report a vulnerability** privately, never in a public issue: see [Security](/docs/community/security). ## Talk to us - [GitHub issues](https://github.com/Synap-core/backend/issues) on the backend repository, for technical questions about the pod. Questions about the CLI go to [its issues](https://github.com/Synap-core/synap-cli/issues), and about these docs to [the docs repository's issues](https://github.com/Synap-core/doc/issues). - [Discord](https://discord.gg/xhRdQ7hG5h), where builders share workspaces, playbooks and capabilities. Everyone taking part follows the [code of conduct](/docs/community/code-of-conduct). # Marketplace listing policy > How the marketplace works on a pod today, and the draft listing criteria and neutrality rule for what Synap lists. URL: https://doc.synap.live/docs/community/marketplace-policy · Last reviewed against the code: 2026-10-20 The listing criteria and the neutrality rule on this page are a **draft** for discussion. They are not yet applied as written. The first section describes how pods behave today. ## How the marketplace works today A pod's marketplace lists packages (workspace templates, capabilities, automations, cells) from **sources**. - **Synap's catalog** is built in. The pod reads it from its configured Control Plane (`https://api.synap.live` by default) every 10 minutes, anonymously. An operator can switch it off with `SYNAP_CATALOG_SOURCE=off`. - **Other sources.** A pod admin can add any other source by its HTTPS address. A source publishes a signed index (`synap-index.json` and its `.sig`, signed with an ed25519 key); the format is documented in [`docs/marketplace-source.md`](https://github.com/Synap-core/backend/blob/main/docs/marketplace-source.md) in the backend repository. The pod admin chooses a trust level for each added source: | Level | Who can install | What the pod checks | |---|---|---| | **Official** (Synap's catalog only) | A person; an agent's install becomes a proposal | The configured Control Plane, over TLS | | **Trusted** | A person, after a preflight that names the code, network access and connectors a package brings | The signed index under the pinned key, not expired; each definition's digest | | **Showcase only** | Nobody on the pod: install opens the publisher's page | The listing only | What holds for every source: - Only a person who administers the pod can add a source, change its trust, or remove it. Agents and API keys are refused. - Updates from a source are never applied automatically. - A package only **adds** to a pod. It is refused when it would overwrite something the pod already has under the same name. - A pod's requests to a source are anonymous `GET`s: no cookies, no keys, no user identity. ## Listing criteria (draft) To be listed in Synap's catalog, a package must: 1. **Say what it does.** A name, a description that matches the package's behaviour, and an icon. 2. **Declare what it reaches.** Every network destination, connector and piece of code it brings shows in the install preflight. Nothing undeclared. 3. **Respect governance.** It works through the pod's normal permission and proposal rules, and asks for no more access than it needs. 4. **Install cleanly.** It installs on a current stable pod without overwriting anything, and removes cleanly. 5. **Have an owner.** A publisher who can be contacted and answers security reports. 6. **Be honest about cost.** If it needs a paid plan or a paid third-party service, the listing says so. Synap may remove a listing that breaks these criteria, after telling the publisher why, except for a security problem, where it may remove it first. ## Neutrality rule (draft) Synap publishes packages and apps of its own in the same catalog as other publishers. The rule: - **The same criteria.** Synap's own packages meet the listing criteria above, checked the same way. - **The same placement.** Search and browsing rank packages by the same rules for everyone. Synap's own packages get no hidden boost, and no placement can be bought. - **Labels describe, they do not rank.** "Official" means "published by Synap" and the trust level a pod gives it; it is not a quality badge. - **No lock-in through the catalog.** A pod admin can add other sources and switch Synap's catalog off. Synap will not make a pod depend on its catalog to keep working. - **Same data rules.** Synap's own packages get no access to a pod's data that a third-party package with the same declared permissions would not get. Comments on this draft are welcome as an [issue on the backend repository](https://github.com/Synap-core/backend/issues). # Security > How to report a vulnerability in Synap privately, and what happens after you do. URL: https://doc.synap.live/docs/community/security · Last reviewed against the code: 2026-10-20 ## Report a vulnerability **Do not open a public issue or pull request for a security problem.** Email **security@synap.live** with: - what is affected: the pod (backend), the CLI, Synap Cloud, an app, or this site, and the version if you know it; - how to reproduce it, and what an attacker could do with it; - whether you want to be credited, and how. This applies to the open-source repositories and to Synap Cloud. ## What happens next We acknowledge your report, investigate, and keep you informed until it is fixed. We ask you not to disclose the problem publicly until a fix is released and pod operators have had a reasonable time to update. ## For pod operators - Keep your pod updated: [Upgrades](/docs/run/upgrades). Automatic updates apply signed releases only. - Keep release verification on: `install.sh` and `synap update` refuse an unsigned or tampered release by default. See [Verifying releases](/docs/run/install#verifying-releases). - Keep the database, MinIO, Typesense and Kratos ports on `127.0.0.1`, as the stock configuration does: only Caddy should face the internet. - Give agents and integrations their own keys with the smallest grant that works: [API keys](/docs/build/api-keys). # Entity connections > The two ways entities connect, structural links and semantic relations, and when to use each. URL: https://doc.synap.live/docs/concepts/entity-connections · Last reviewed against the code: 2026-11-04 Records in your pod connect to each other in two ways. A **structural link** is a field on a record that points to another record, such as the contact on a deal. A **semantic relation** is a typed edge in the pod's graph, such as a note that references a decision. You read both together, in one list. ## The two systems | | Structural links | Semantic relations | |---|---|---| | **Stored as** | A field whose value is another record's id (`valueType: "entity_id"`) | A relation with a type, between two records | | **Defined by** | The kind's fields, set up with the space or its template | Any time, by a person, an agent or an automation | | **Direction** | From the record that holds the field | Readable from either end | | **Good for** | The core data model: "this deal's primary contact" | Knowledge found later: "this note references that decision" | ## Structural links A structural link is a field of type `entity_id` on a kind. Its value is the id of another record. For example, a `deal` kind could have a `contact` field; every deal then shows it as a field people fill in. Use a structural link when: - the link is part of what the record is, and most records of that kind have it; - you want it to appear as a field in forms; - the link has a clear direction ("a deal has one primary contact"); - you are writing a template: model each relationship your kinds need as a field. A field can also name a relation type. Writing that field then creates the matching relation in the graph, and clearing it removes the relation, so the link shows up in graph queries too. ## Semantic relations A semantic relation joins two records with a type, such as `references`, `mentions` or `blocks`. No field defines it: a person, an agent or an automation creates one between any two records when it finds the connection. ```json { "sourceEntityId": "", "targetEntityId": "", "type": "references" } ``` Use a semantic relation when: - the connection is found after the fact, not modelled up front; - it joins records of any kinds, with no field behind it; - you want to walk the graph, such as everything two hops from a record; - it is many-to-many and does not fit a field; - an agent is annotating what it found. The type must be one the pod knows. Every pod has a set of default types, such as `relates_to`, `references`, `mentions`, `parent_of`, `depends_on`, `blocks`, `assigned_to`, `created_by` and `works_at`, and a space or its template can add its own. `synap_list_profiles` returns the relation types you may use. ## When both could work A deal could have a `contact` field, or a `relates_to` relation to the same person. The rule of thumb: > **Use fields for what the kind's schema owns. Use relations for what you discover.** An assignee on a task is a field: it is part of the task. A `references` relation between two documents is a relation: it came from reading them. ## One list of connections `GET /api/hub/entities/{id}/connections` (scope `hub-protocol.read`) returns every connection around a record, from both systems and from the rest of the pod, in one list. Each item has a `source`: | `source` | What it is | |---|---| | `graph` | A semantic relation, with its `relationType` and a `direction` of `outgoing` or `incoming` | | `property` | A structural link, with its `propertySlug` and `propertyLabel` | | `thread` | A conversation that used, created, updated or referenced the record | | `context_channel` | A conversation about the record | | `focus_session` | A session whose subject is the record | The answer is `{ connections, counts }`. `limit` caps the items read from each source (default 50, at most 200), and `workspaceId` reads through one space. The typed client wraps it: `client.getConnections(entityId)` from `@synap-core/hub-rest-client`. `GET /api/hub/relations` reads only the graph, so a structural link whose field names no relation type is missing there. Use `/connections` when you want every link without knowing where it is stored. ## For agents - **Set a field** when the link is a defined field (an assignee, the contact on a deal). - **Create a relation** for a connection you discover: `synap_link_entities` over MCP, or `POST /api/hub/relations`. - **Read the connections** to see every link around a record: `GET /api/hub/entities/{id}/connections`, or `synap_get_relations` over MCP for the graph edges alone. ## Related - [Kind and facets](/docs/concepts/kind-and-facets) - [Profile schemas](/docs/concepts/profile-schemas) - [Hub REST API](/docs/reference/hub-api) # Glossary > The terms used across the Synap docs, in one place. URL: https://doc.synap.live/docs/concepts/glossary · Last reviewed against the code: 2026-10-20 ### Agent An AI program that works on your pod through MCP or the Hub REST API, for example Claude Code, Codex or Cursor. Each connected agent has its own identity and key on the pod. ### API key A bearer token that lets an app, script or agent call your pod. It has scopes (which surfaces it may call) and a grant (what it may touch). See [API keys](/docs/build/api-keys). ### Automation A trigger (an event, a schedule (cron), a webhook, or a manual start) and the flow of steps it runs. Starting a playbook is one kind of step. See [Automations and playbooks](/docs/customize/automations-and-playbooks). ### Capability Something your pod can do with an outside service or with your own code, such as sending an email or searching the web: a connection to one service plus the verbs that use it. Shown in the apps as a **Tool**. See [Capabilities](/docs/customize/capabilities). ### Channel A conversation room. A session has a channel where you and your agents work on the same goal. ### Control Plane The Synap Cloud service at `api.synap.live` that creates and manages hosted pods, handles Synap accounts and billing, and serves the marketplace catalog. A self-hosted pod can work without it. ### Entity One record in your pod: a person, a task, a note. Every entity has exactly one kind and zero or more roles. ### Event An append-only record of a change. The event log is the pod's audit trail. ### Facet Another name for a role attached to an entity. ### Hub REST API The pod's HTTP API under `/api/hub`, used by agents, scripts and integrations. Every pod publishes its OpenAPI description at `/api/hub/openapi.json`. See [Hub REST API](/docs/reference/hub-api). ### Kind What an entity is: `person`, `task`, `event`, `note`, `article`, `decision`, or a kind you define. ### MCP Model Context Protocol, the standard AI clients use to call tools. Every pod serves an MCP endpoint at `/mcp`. See [MCP](/docs/agents/mcp). ### Playbook A session shape you can run again: a template for one kind of work, or a method a project runs as a track. Shown in the apps as a **Template**. ### Pod Your Synap server: the API, PostgreSQL database, search, file storage and sign-in, run as a set of containers. Self-hosted or on Synap Cloud. ### Pod admin console The pod's web console for its owner and admins, served on its own host name next to the pod (for example `pod-admin.example.com`). ### Project Long-lived intent: something you are doing over weeks or months. Its progress is derived from the work it contains. ### Proposal A change an agent asks to make and that waits for a person. You review it and approve or reject it. Shown in the apps as a **Request**. Under the default write mode, an agent's creates and edits apply directly with Undo, and its deletions and structural changes become proposals. Deletes, admin actions and changes of scope are always proposals; an agent's own key can never approve one. See [Validation policy](/docs/concepts/validation-policy). ### Relay The Synap mobile app (iOS and Android), where you approve proposals and capture things. It is in beta testing and not yet in the app stores. See [Relay](/docs/use/relay). ### Role A context an entity plays, such as `client` or `blocker`. A role is attached to the entity; it is not a second entity. Also called a facet. ### Session A bounded unit of work toward one goal, with a scope you accept before it runs. It can stand alone or be filed at a track and stage. Shown in the apps as a **Job**. ### Skill A folder of instructions (a `SKILL.md` and reference files) that teaches an agent how to use Synap. Shown in the apps as a **Tool**. See [Agent skills](/docs/agents/skills). ### Stage One step of a track. A session can be filed at a track and one of its stages. Shown in the apps as a **Step**. ### Synap Cloud Synap's hosted service: Synap runs your pod for you. See [Self-hosted pod or Synap Cloud](/docs/use/cloud-vs-self-hosted). ### Tool The word the apps use for capabilities, skills and tools alike: three kinds of thing in your pod, one word on screen. A Tool's own page still says which kind it is. In the pod and its API, a `tool` is one part of a capability: the connection to one service, with where its API is and which credential it uses. ### Track A reusable method running inside one project, such as "Content" or "Build". It keeps the definition it started from. Shown in the apps as a **Goal**. ### View A projection over your records (a table, board, calendar, graph and so on). It never copies data. ### Workspace A space inside your pod that groups records, views and members, such as a business workspace and a personal one. Shown in the apps as a **Space**. ### Write mode How an agent's changes land, chosen when you connect the agent: **Normal** (the default: creates and edits apply directly with Undo; deletions and structural changes ask you), **Creates only** (creates apply with Undo; everything else asks you) or **Ask first** (every change asks you). See [Validation policy](/docs/concepts/validation-policy). # Hub Protocol flow > The path of a request from an agent or script through the Hub REST API to the pod. URL: https://doc.synap.live/docs/concepts/hub-protocol-flow · Last reviewed against the code: 2026-11-04 The Hub Protocol is the pod's HTTP API, served under `/api/hub`. Agents, scripts and integrations in any language use it to read and change what is in a pod. This page follows one request from the caller to the pod's records; the [Hub REST API](/docs/reference/hub-api) reference lists every route. ## The path of a request 1. **The caller authenticates.** A script or agent sends an API key as `Authorization: Bearer `. A web client signed in to the pod can send its session token as `X-Session-Token` instead. 2. **The pod works out who is calling.** A key held by an agent acts as that agent, on behalf of the person it works for. Any other key acts as the person who owns it. 3. **The key's limits are checked.** Most routes check `hub-protocol.read` to read and `hub-protocol.write` to write; a few pod-setup routes require another scope, such as `hub-protocol.admin`. If the key has a grant, the request must stay inside it. 4. **A read returns** only the records the caller is allowed to see (see [Permission model](/docs/concepts/permission-model)). 5. **A write is governed.** The pod checks the caller's permission, then, for an agent, the [validation policy](/docs/concepts/validation-policy). The write runs, becomes a proposal, or is refused. A proposal is a success: the answer carries `status: "proposed"` and a `proposalId`. 6. **A change that runs is recorded** in the pod's event log, and its follow-up work runs from there: search indexing, automations and [webhooks](/docs/build/webhooks). Because every step runs on the pod, an agent's write over the Hub REST API is checked and recorded the same way as a person's change in the apps. ## What it covers Records (entities, relations, documents, views), conversations (channels and threads), memory and knowledge, sessions and playbooks, proposals, automations, capabilities and tools, connectors and webhooks, and pod setup. Each pod publishes its exact routes at `/api/hub/openapi.json`. See also: - [Hub REST API](/docs/reference/hub-api) - [API keys](/docs/build/api-keys) # Concepts > How Synap works, in reading order, from what a pod is to how two pods stay in sync. URL: https://doc.synap.live/docs/concepts · Last reviewed against the code: 2026-11-04 These pages explain how Synap works: what a pod holds, how its records are shaped, and how the changes your agents make are governed. Read them in order; each one builds on the one before. The first page is for everyone who uses Synap. The data model and governance pages go into the detail you need to build on a pod or write a template. ## Start with the model ## The data model ## Governance ## Under the hood ## Look up a term # Kind and facets > One entity, one kind, many roles: how Synap separates what a thing is from the roles it plays. URL: https://doc.synap.live/docs/concepts/kind-and-facets · Last reviewed against the code: 2026-11-04 One real-world thing is one entity in your pod. What it is used as in a given context is a **role** (also called a **facet**), attached to that entity. A role is never a second entity. ## The rule Every entity answers three separate questions: - **What it is**: its **kind**. A person, a company, a task. Every entity has exactly one kind, set when it is created, and it rarely changes. - **What it is used as, and where**: its **roles**. A client in your sales space, an investor in another, a speaker at one event. Roles are attached and detached over time, and an entity can have several at once. - **What it is connected to**: its relations. Works at, assigned to, blocks. See [Entity connections](/docs/concepts/entity-connections). The mistake this prevents: recording "Anna is now a client" by creating a second record called "client" next to the person Anna. In Synap, Anna stays one `person`, and a `client` role is attached to her. Everything about Anna (her email, her notes, her meetings, the deals she is part of) stays on one entity, whatever roles she plays. A role carries its own status and its own fields. A `client` role can have a status such as active or paused and a "became client at" date; those live on the role, not on the person. A role can also be attached in one space only, so the people in that space see it while the person stays the same entity everywhere. ## When something should be a kind instead Not every recurring role should stay a role. Ask: does it have its own life, with its own timeline, its own links to other things and its own states that outlive any single person or company? If so, it is a kind. A `deal` is a kind. It is not "a person in the won state": it has its own buyer, its own stage, its own value and close date, and its own linked contacts and documents. An `event` is a kind for the same reason: a time-bound thing, not a role someone plays. `client`, `partner` and `lead` are roles. They describe a stance a person or company takes and have no existence outside that person or company. Detach a role and the entity is untouched; delete the entity and its roles go with it. Rule of thumb: if it could outlive its parent, or be shared by several parents with links of its own, it is a kind. If it belongs to one entity and only changes that entity's stance, it is a role. ## Example: a CRM The CRM template models relationship state as roles on people and companies, with deals as their own kind: - `person` and `company` are kinds. The CRM adds a few contact fields to them, such as lead source and next follow-up date, but no pipeline stage: a lead's stage lives on its `lead` role, a deal's on the deal. - `lead`, `client` and `partner` are roles. A person you start pursuing gets the `lead` role; when you win a deal, the company gets the `client` role. The person and the company stay the same entities throughout. - `deal` is a kind, with its own stage, value and close date. It links to the person or company; it is not a role. A client who leaves keeps their entity: you change the `client` role's status or detach the role, and their history stays on the person or company. ## Finding the right entity first Before attaching a role, the pod helps you find the entity that already exists, so the role does not land on a duplicate: - **Strong signals** (an email address, a phone number, a URL such as a LinkedIn profile or a website, a handle, an external id) identify one entity. A match on any of them resolves to that entity: enrich it or attach a role to it, do not create a new one. - **Weak signals** (a name) only suggest candidates. They never merge two records on their own; when two people share a name, you or the agent choose. ## How an app or agent attaches a role Through MCP: | Tool | What it does | |---|---| | `synap_resolve_identity` | Checks, before creating anything, whether an entity already matches the signals you have. It never writes. | | `synap_attach_facet` | Attaches a role to an existing entity, by the role's slug (for example `client`). | | `synap_detach_facet` | Detaches a role. The entity is never deleted. | | `synap_define_role` | Defines a new role, or widens the kinds an existing role applies to. | | `synap_list_profiles` | Lists the kinds and roles on your pod, and which kinds each role applies to. | Through the Hub REST API: `POST /api/hub/identity/resolve` runs the same identity check, `GET` and `POST /api/hub/entities/{entityId}/facets` list and attach roles, `PATCH /api/hub/facets/{facetId}` changes a role's status or fields, and `DELETE /api/hub/facets/{facetId}` detaches it. See the [Hub REST API](/docs/reference/hub-api). Attaching a role again after it was detached works: a client who leaves and comes back needs no special case. By default an agent's attach, update and detach of a role apply directly; a detached role is kept in the history and can be attached again. An agent defining a new role always becomes a proposal for you to approve. Any of these calls may answer `status: "proposed"`: that means the change waits for review, not that it failed. See [Validation policy](/docs/concepts/validation-policy). ## Related - [Entity connections](/docs/concepts/entity-connections): relations and structural links - [Profile schemas](/docs/concepts/profile-schemas): how fields are defined and scoped # Permission model > Who can see and change what on a pod, for people, agents, apps and API keys. URL: https://doc.synap.live/docs/concepts/permission-model · Last reviewed against the code: 2026-11-04 Every request to your pod is checked on the pod itself, whichever app, agent or script sends it. The pod asks two questions: who is calling, and what may that caller see and change. ## Who is calling - **A person** signs in to the pod (in the apps or the pod admin console) and acts as themselves. - **An agent** connects with its own key and its own identity. It sees what the person it works for can see, and its changes are recorded as the agent's. - **An app** that you approve gets its own agent identity too, so its changes follow the same rules as an agent's. - **A script or integration** uses an [API key](/docs/build/api-keys) that acts for the person who created it. ## What a person can see Records live in spaces (workspaces). Each kind is either shared by the whole pod, like `person` and `company`, or kept inside the space it belongs to, like a CRM `deal`. You see a space's records when you are a member of that space. Each member of a space has a role: | Role | What it adds | |---|---| | **Viewer** | Reads the space's records and views | | **Editor** | Also creates, edits and archives records | | **Admin** | Also manages the space and invites members | | **Owner** | Also deletes | When your role does not allow a change, you can still ask for it: the change becomes a proposal (shown in the apps as a **Request**) for the space's owners and admins to approve. A space can let its editors approve too. If nobody else could approve it, the change is refused. ## What a key can do An API key has two limits on top of the person it acts for: - its **scopes** name the API surfaces it may call, such as the Hub REST API or MCP; - its **grant** narrows what it may touch there: some kinds, some actions, some spaces, projects or single records. A key can never do more than its person can. See [API keys](/docs/build/api-keys). ## What happens to a change A person's change runs when that person's role allows it. A change made by an agent, an app or an automation passes the same check, then goes through the [validation policy](/docs/concepts/validation-policy): it runs directly, becomes a proposal for a person to approve, or is refused. Because the checks run on the pod and not in the apps, the same rules hold for the apps, MCP, the Hub REST API and the SDK. See also: - [Validation policy](/docs/concepts/validation-policy) - [API keys](/docs/build/api-keys) # Pod linking and replication > How to link two of your pods as a primary and a replica, what the replica receives, and how often. URL: https://doc.synap.live/docs/concepts/pod-replication · Last reviewed against the code: 2026-11-04 Linking keeps a second, live copy of a pod. You link two pods you own: the **primary**, the pod you use every day, and the **replica**, which receives a copy of everything the primary records. A replica can serve as a standby, a copy on another server, or a copy you host yourself next to a pod Synap hosts for you. Linking is not the same as a backup. A replica follows the primary within seconds, so a mistake on the primary reaches the replica too. To go back to an earlier state, use [backups](/docs/run/backups). ## Link two pods 1. Sign in on [synap.live](https://synap.live) and open your pod. 2. Open **Pod linking** and choose **Link another Pod**. 3. Pick the other pod, and choose this pod's role: **primary** (it sends data) or **replica** (it receives data). 4. Choose **Confirm link**. synap.live asks you to confirm it is you before the link is made. Both pods must belong to your Synap account and be running. That can be a pod Synap hosts for you or a self-hosted pod you [registered with the Control Plane](/docs/run/connect-control-plane#register-the-pod-with-the-control-plane). A pod can be linked to one other pod at a time: a link always joins exactly two pods. When you link, the Control Plane creates a secret that only the two pods share and gives it to each of them. From then on the pods talk to each other directly over HTTPS; your data does not pass through the Control Plane. Once the pods are linked, the same panel shows this pod's role and the pod it is linked to. **Unlink Pods** stops the sync on both pods at once. Each pod keeps the data it already has. To follow the sync itself, open the [pod admin console](/docs/concepts/glossary#pod-admin-console) of either pod and go to **Backups**: the **Sync** card lists the other pod, the number of events synced, and the last error if there is one. ## What the replica receives | What | When | |---|---| | Every change to your records (entities, relations, views, documents and the rest of the event history) | Sent as soon as it happens, with a check every minute that catches up on anything missed | | Spaces and their members, channels and messages, automations and their runs, property definitions, and your AI service settings | Every 5 minutes | | The content of files and documents up to 10 MB each, and their version history (larger files are not copied) | Every 10 minutes | On the first link, the replica also catches up on the primary's existing history. Every space is replicated. API keys for AI services are never copied: each pod keeps its own. Sync goes one way, from the primary to the replica. A change made directly on the replica is not sent back to the primary. ## When both pods changed the same record When a change arrives for a record the replica already has, the version with the later time is kept: a newer change from the primary replaces the replica's copy, and an older one is skipped. The pod records each such case. There is no screen to merge two versions field by field. ## When a pod is unreachable If one pod cannot reach the other, the changes wait and the next run sends them. After 10 failed runs in a row, the pod stops trying that peer. The **Sync** card in the pod admin console then shows the last error and a **Retry** button, which clears the error so the next run tries again. ## What linking does not do - Link three or more pods together. - Swap the primary and the replica from synap.live. - Promise a delay: changes usually arrive within seconds, and the scheduled runs above catch up after an outage. ## Where to go next - [Backups](/docs/run/backups): snapshots you can restore, the other way to keep a copy - [Connect to the Control Plane](/docs/run/connect-control-plane): register a self-hosted pod with your Synap account # Profile schemas > How field definitions are layered so the same kind can carry different fields in different spaces. URL: https://doc.synap.live/docs/concepts/profile-schemas · Last reviewed against the code: 2026-11-04 A profile is the schema of a kind or a role: the fields its records carry. One person in your pod can show different fields in your Sales space and in your Studio space. The record is the same; each space adds its own fields on top of a shared base. Several spaces with different jobs share one set of records without their fields colliding or leaking into each other. ## The three layers Every field definition lives in one of three layers: | Layer | Who sees it | Example | |---|---|---| | **Global** | Every profile that uses it | A field the system defines once and several kinds share | | **Profile base** | Every space that uses the profile | `status` and `priority` on a task | | **Space overlay** | Only the space that added it | Sales adds `investmentThesis` to the pod-wide `person` | When you open a record in a space, its fields are the global and base fields of its profile plus that space's own overlay fields. Another space's overlay fields are left out. ## A worked example You run three spaces on one pod, and all three use the `person` kind. You create one person, Alice Chen. - In Sales you add a field `investmentThesis` to `person`. It becomes a Sales overlay. - In Knowledge you add `notesCount` to `person`. It becomes a Knowledge overlay. - Studio adds nothing to `person`. Open Alice in Sales and you see the base fields of `person` plus `investmentThesis`. Open her in Knowledge and you see the base fields plus `notesCount`. Open her in Studio and you see the base fields only. There is one Alice in all three cases. ## What it allows - **One record, several jobs.** A freelancer with a Sales space and a Studio space can track Alice as a prospect and as an audience member, each space with its own fields. - **Independent spaces.** A field added in Sales does not appear in Studio. - **Templates that add fields.** A template that extends a profile it does not own, such as the pod-wide `person`, adds its fields as overlays of the space it is installed in. A template that defines its own kind gives that kind base fields. ## Writing a field another space owns A write is checked through the space it is made in. A value for a field that space cannot see is treated as an unknown field: it is stored as sent, but it is not validated and cannot be queried. The write's answer lists it as unmodelled, with the closest known field name when there is one. It is not refused: the pod keeps extra keys so older clients keep working, and reports them so the writer learns the field is not modelled. ## What it does not do - **It does not decide which records you see.** Layers control which fields appear, not which records a space can reach. That is decided by the record's scope: a record visible to the whole pod, or to one space. - **It does not set per-field permissions.** A member of a space sees every field in that space's view of a profile, and a member whose role can edit records can edit all of them. - **It does not share fields between overlays.** Two spaces that each add `status` to `person` get two independent fields. To share one, define it in the profile base. ## Where to see a kind's fields - Over MCP, `synap_get_entity` returns a record with its `effectiveProperties`: the fields it carries in the space you read it through. - Over HTTP, `GET /api/hub/discover?userId=&profileSlugs=` describes a kind's fields; add `workspaceId=` to see that space's fields. ## Related - [Kind and facets](/docs/concepts/kind-and-facets) - [Entity connections](/docs/concepts/entity-connections) # Validation policy > How the pod decides whether a requested change runs directly, becomes a proposal, or is refused. URL: https://doc.synap.live/docs/concepts/validation-policy · Last reviewed against the code: 2026-11-03 The validation policy decides what happens to a change an agent asks to make: it runs directly, it becomes a proposal (shown in the apps as a **Request**) that waits for a person, or it is refused. ## People and agents A change made by a person runs if that person has the permission for it. See [Permission model](/docs/concepts/permission-model). A change made by an agent goes through the same permission check first, then through the policy below. ## Write modes Each agent has a write mode. You choose it when you connect the agent: the page in the pod admin console where you approve a computer and its agents (`synap init`) asks how the agents' changes land, and `synap connect claude-code` asks the same in the terminal. You can change it at any time on the agent's page in the pod admin console. | Write mode | What it does | |---|---| | **Normal** (recommended, the default) | Creates and edits apply directly with Undo; deletions and structural changes ask you. | | **Creates only** | Creates apply directly with Undo; edits, deletions and structural changes ask you. | | **Ask first** | Every change asks you first. | An agent you have not configured follows the pod's default, which is **Normal**: a pod-wide rule lets an agent's reversible writes run directly. A change that runs directly is still recorded, and you can undo it. ## What always asks you Some changes become a proposal whatever the write mode and whatever rule you add. No rule can widen them: - **Destructive actions**: delete, archive, purge and merge. - **Administrative actions**: changing a space's settings, adding or removing members, changing a member's role, changing what an agent may do. - **Changes of scope or identity**, for example making a record visible to the whole pod, or changing its kind. - **An agent defining a kind or a role.** A person defining one is not affected. - **An agent creating a space, cell, playbook or automation**, or activating an automation. A person doing the same is not affected. - **Human gates**: approvals whose whole purpose is that a person says yes, such as approving a plan before an agent writes code. An agent's own key can never approve a proposal, its own or anyone else's. Approval is a human step. ## Other things that make a change ask you - **Rules you add.** On top of the write mode, you can add rules that let a kind of write run directly or make it ask you, for one agent or for the whole pod. A rule can never loosen the list above. - **Untrusted origin.** A write that comes from outside the pod's trusted channels, such as an external connector, becomes a proposal even when the agent's write mode would run it directly. - **A daily limit.** A pod can cap how many writes an agent runs directly each day; past the cap, the rest become proposals. There is no cap unless one is set. ## Refused A change is refused when the caller lacks the permission for it, when the agent lacks the capability it needs, or when a person set a rule that says never. ## What an app or script sees A write through MCP, the SDK or the Hub REST API answers with the outcome. A proposal comes back as `status: "proposed"` with a `proposalId`; this is a success, not an error. The change is applied when a person approves the proposal. See also: - [Permission model](/docs/concepts/permission-model) - [Connect your AI](/docs/agents) # Views > A view shows your records as a table, a board, a calendar or a graph without copying them; the view types you can create. URL: https://doc.synap.live/docs/concepts/views · Last reviewed against the code: 2026-11-04 A view is a way of looking at records you already have. It is not a copy of your data: it stores a query (which records, filtered and sorted how) and a configuration (how to draw them). Show the same tasks as a sheet, a kanban board grouped by status, or a calendar, and the tasks stay where they are. Edit a record in one view and every other view shows the change. ## View types you can create | View type | Shows records as | |---|---| | `sheet` | A spreadsheet-like table | | `list` | A list, optionally grouped by a field | | `grid` | Cards in a grid | | `gallery` | Cards led by a cover image taken from a field | | `kanban` | Columns grouped by a field, such as a status | | `matrix` | A two-axis grid, one field for columns and one for rows | | `masonry` | A feed of cards of varying height | | `calendar` | Items placed on dates | | `gantt` | Bars between a start date and an end date | | `timeline` | Events in time order | | `graph` | Records and the links between them | | `flow` | A directed graph or flowchart, for processes and workflows | | `map` | Locations on a map, optionally joined by routes | | `bento` | A dashboard of widgets, each showing a number, a chart or another view | | `whiteboard` | A free canvas you draw on | A whiteboard holds the shapes drawn on it rather than a query. The others read your records each time they open. Four more types still open but are not offered for a new view: `table` (replaced by `sheet`), `zoom_map` (retired as a new view), `branch_tree` (used only inside a conversation) and `pipeline` (created by the features that use it). ## Creating a view - **From an agent**: `synap_create_view` takes a name, a type, a space or a project, and an optional configuration. Call `synap_list_views` first so you do not create a duplicate, and `synap_list_widgets` before you place widgets on a bento. See [MCP tools](/docs/reference/mcp-tools). - **Over HTTP**: `GET` and `POST /api/hub/views` list and create views, and `PATCH /api/hub/views/{viewId}` changes one. See the [Hub REST API](/docs/reference/hub-api). Because a view is configuration, an agent can build one from a plain request. "Show my deals as a board by stage" becomes a `kanban` view of the `deal` kind with `groupByField` set to the stage field. An agent's new view follows the [validation policy](/docs/concepts/validation-policy) like any other write, so it can come back as a proposal. # What is Synap? > A data pod you own, with a governed place for AI agents to work on your records. URL: https://doc.synap.live/docs/concepts/what-is-synap · Last reviewed against the code: 2026-10-20 Synap is a **data pod**: a backend that holds your records in your own PostgreSQL database. You connect the AI agents you already use (Claude Code, Codex, Cursor, or anything that speaks MCP), and they work on those records under permissions you grant. Their changes are governed: by default an agent's creates and edits apply directly and can be undone, while deletions and structural changes become **proposals** you approve. Every change is written to an append-only event log. You can run the pod yourself (it is open source, MIT-licensed) or let Synap run it for you on Synap Cloud. Both run the same code. ## Two layers Synap has two layers. Keeping them apart is the easiest way to understand it. | Layer | What it is | |---|---| | **The data model** | Kinds, roles, views and events. It makes your pod queryable. | | **The unit of work** | Projects, tracks and sessions, plus playbooks and automations. It gives agent work a shape. | ## The data model | Concept | What it is | Example | |---|---|---| | **Kind** | What an entity *is*. Every entity has exactly one kind. | `person`, `task`, `event`, `note`, `article`, `decision` | | **Role** (also called a **facet**) | A context an entity plays. It is attached to the entity, not a second entity. An entity has zero or more roles. | `client`, `partner`, `blocker`, `milestone` | | **View** | A projection over the same records, never a copy. | A board of tasks that carry the `blocker` role | | **Event** | Every write, appended to the event log. | The audit trail of a change | The rule that trips people up: if something has its own identity and fields, it is a **kind**. If it is a context the same thing can be in, it is a **role**. Anna is one `person`. She can be a `client` in your business workspace and a `friend` in your personal one, and there is still only one Anna. A CRM view reads the `client` role, a personal view reads the `friend` role, and nothing is copied or synced between them. [Kind and facets](/docs/concepts/kind-and-facets) goes deeper. ## The unit of work ``` Project long-lived intent: a thing you are actually doing, over months └── Track a method running inside one project ("Content", "Build") └── Session a bounded piece of work toward one goal Or a session on its own. Most sessions are. ``` - A **project** is long-lived intent. Its progress is derived from the work it contains, never stored as a percentage. - A **track** is a reusable method running inside one project. It keeps the definition it started from, so editing the method later does not rewrite a track that is already running. Tracks are started by a person or an agent; a project does not get tracks automatically. - A **session** is a bounded unit of work toward one goal, with a scope you accept before it runs. A session can be filed at a track and stage, or stand on its own in a workspace with no project at all. - A session has a **channel**: a room where you and your agents work on the same goal, with proposals and outputs visible in the conversation. Two things make work repeatable: - A **playbook** is a session shape you can run again. A playbook is either a template for one kind of work, or a method a project runs as a track. - An **automation** binds a playbook to a trigger: an event, a schedule (cron), a webhook, or a manual start. The apps use everyday words for these: a workspace is a **Space**, a track a **Goal**, a stage a **Step**, a session a **Job**, a playbook a **Template** and a proposal a **Request**. The API, the CLI and the MCP tools keep the names used on this page. ## Governance: proposals and approval When an agent wants to change your data, the pod decides between two outcomes: - **Apply directly**: the change is applied, leaves a record, and you can undo it. - **Propose**: the change becomes a proposal (shown in the apps as a **Request**). You review it, then approve or reject it. Which outcome a change gets depends on the agent's **write mode**, which you choose when you connect the agent and can change later: | Write mode | What applies directly | What becomes a proposal | |---|---|---| | **Normal** (the default) | Creates and edits, with Undo | Deletions and structural changes | | **Creates only** | Creates, with Undo | Edits, deletions and structural changes | | **Ask first** | Nothing | Every change | Some changes always become proposals, whatever the mode or rule: deletes and other destructive actions (archive, purge, merge), admin actions such as membership and what an agent may do, changes of scope, an agent defining a kind or role, and an agent creating a space, cell, playbook or automation. An agent's own key can never approve a proposal; approval is a human step. [Validation policy](/docs/concepts/validation-policy) has the details. Either way, every change is on the event log, which is append-only. That log is the audit trail: you can see what changed, who or what changed it, and when. ## Where your data lives A pod is a set of containers: PostgreSQL (with TimescaleDB for the event log), Typesense for full-text search, MinIO for files, Redis, and Ory Kratos for sign-in, all behind a Caddy web server with automatic HTTPS. Your records are in PostgreSQL, so you can export them with standard tools. ## Bring your own agent Synap does not sell or meter inference. An agent connects to your pod over MCP or the Hub REST API with its own identity and key, and works on the same records you do. Changing agents does not lose your context, because the context is in your pod. See [Connect your AI](/docs/agents). ## Next - [Cloud quickstart](/docs/start/cloud-quickstart): a hosted pod, connected in one command. - [Self-host quickstart](/docs/start/self-host-quickstart): your own pod on your own server. - [Glossary](/docs/concepts/glossary): every term on one page. # Automations and playbooks > Make work repeatable. A playbook is the work you can run again, an automation decides when it runs, and capabilities are the tools both use. URL: https://doc.synap.live/docs/customize/automations-and-playbooks · Last reviewed against the code: 2026-11-03 Three pieces compose every repeatable process on a pod: | Piece | Answers | What it is | |---|---|---| | [Capability](/docs/customize/capabilities) | With what? | A tool the pod can run: a verb such as "send an email" or "search the web". | | **Playbook** (a template in the apps) | What? | The reusable work: a goal, optional stages and acceptance criteria. Each run is a session that an agent works on. | | **Automation** | When? | A trigger (an event, a schedule, an incoming webhook or a manual start) and a flow of steps. A step can call a verb or start a playbook. | Keep them apart: an automation should not hold the work itself, and a playbook should not decide when it runs. ## Playbooks A playbook needs a `name` and a `goalTemplate`. It can also declare: - `params`: inputs asked for when it runs, referenced in the goal as `{name}` (for example `Analyze competitors for {market}`). An undeclared name, or `{{name}}`, is refused. - `stages`: ordered steps, each with a `key`, a `name` and a `category` (`backlog`, `planned`, `started`, `paused`, `completed` or `canceled`), and optionally a gate where a person must say yes. - `criteria`: binary statements every run is graded against. - a subject kind: the kind of record it runs on, such as a company or a lead. ### Create one - **Your agent**: ask for it. `synap_create_playbook` files it as a proposal you approve. An agent can also turn a session that went well into a playbook with `synap_promote_session_to_playbook`. - **The API**: `POST /api/hub/playbooks` with `name`, `goalTemplate` and `workspaceId`, plus any of `description`, `stages`, `params`, `criteria` and `subjectProfile` (for example `{ "profileSlug": "company" }`). See [Playbooks in the Hub REST API](/docs/reference/hub-api/playbooks). - **A template**: workspaces from the [marketplace](/docs/customize/marketplace) bring their own playbooks. ### Run one ```bash synap playbook run "" --subject --param market=Europe ``` Your agent runs one with `synap_run_playbook`, and the API with `POST /api/hub/playbooks/{id}/run` (`subjectId`, `params`, `workspaceId`). A run creates a session and hands it to the playbook's executor. It can come back: | Status | Meaning | |---|---| | `running` | It started. | | `draft` | An agent launched it: it waits in your sessions until you accept it. | | `proposed` | A rule or a limit asks you first. | | `blocked` | Nothing ran: the playbook uses verbs that are not turned on yet. The answer names them. | | `skipped` | Nothing ran, for the reason in `message` (for example, the record's last run failed recently). | ### Let a goal run on its own A playbook can declare **workers**: what starts it by itself. Your agent turns one on for a goal with `synap_enable_worker`, named by its trigger: `schedule:` (for example `schedule:0 9 * * 1`, every Monday at 09:00 UTC), `enters_status:` (when a record enters that status), `count:` (when enough records are in it) or `created`. Its mode says whether each run asks you first (`propose`, the default) or just runs (`run`). ## Automations ### Triggers | Trigger | Fires | Settings (`triggerConfig`) | |---|---|---| | `event` | When something happens on the pod | `eventPattern`, such as `entity.create.completed` or `entity.*`, and optional `filters` on the event's data, such as `{ "profileSlug": "company" }` | | `cron` | On a schedule | `expression`, a 5-field cron expression such as `0 9 * * MON` | | `webhook` | When an outside service posts to the pod | `webhookSource: { "name": … }`, an inbound webhook source a pod admin created. See [Import your data](/docs/customize/import#webhooks-in). | | `manual` | When you start it | none | Match events in the `.completed` phase: it fires for every change that lands, whether it ran directly or was approved. The `.validated` phase fires only for changes that went through a proposal. Filters compare values exactly, or with `$eq`, `$ne`, `$in`, `$gt`, `$gte`, `$lt` and `$lte`. A record's properties are flat in the event data: filter on `score`, not `properties.score`. ### The flow The flow is a set of `nodes` joined by `edges`. It starts at its `trigger` node. The steps you will use most: | Step | Does | |---|---| | `output` | An action: a notification, a record created or updated, a role attached, a relation, a webhook call, a channel message, or a session update | | `condition`, `switch` | Branch on a value | | `fetch` | Call a URL | | `transform`, `compute` | Reshape or compute values | | `query`, `entity_read`, `related_entities` | Read records | | `loop` | Repeat steps for each item | | `capability` | Run a verb (its `verbId` must exist on your pod) | | `skill` | Run a skill by ID | | `playbook_run` | Start a run of a playbook, by `playbookId` or `playbookName`. This is how an automation starts a session. | | `sub_automation` | Run another automation | Text in a step can use the trigger and earlier steps: `{{trigger.payload.subjectId}}` (the record the event is about), `{{trigger.payload.data.title}}`, `{{steps..output}}`. The full reference, with every step type and its fields, is served by your pod: ```bash synap automation schema # or GET /api/hub/automations/schema ``` ### Create and manage one - **Your agent**: `synap_create_automation`. It is always a proposal; once approved, the automation is live. An agent's automation must also carry a short contract of what it reads, stores and does (`metadata.dataContract`, below), or it is refused. - **The API**: `POST /api/hub/automations/create` with `name`, `triggerType`, `triggerConfig`, `flowDefinition`, `workspaceId` and `status` (`draft` by default, or `active`). See [Automations in the Hub REST API](/docs/reference/hub-api/automations). ```bash synap automation list synap automation describe synap automation enable # make it live synap automation disable # pause it ``` To run one now, outside its trigger: `synap_trigger_automation` for an agent, or `POST /api/hub/automations/{automationId}/trigger`. A run is not a proposal, but every write its steps make goes through the same governance as any other write. ## Example: research every new company This puts the three pieces together: when a company is added to your pod, start a research session on it, in which an agent can use the search capability you installed. **Install the tool.** Install a web search capability from the marketplace and turn it on, then check the name of its search verb: ```bash synap capability add synap capability list ``` **Create the playbook** (the work). With a key that has the `hub-protocol.write` scope: ```bash curl -X POST https://pod.example.com/api/hub/playbooks \ -H "Authorization: Bearer $SYNAP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "workspaceId": "", "name": "Research a company", "goalTemplate": "Research this company on the web and record what it does, who runs it and recent news", "subjectProfile": { "profileSlug": "company" } }' ``` The automation below refers to the playbook by name, so the playbook must exist first. If an agent created it, approve its proposal before the next step. **Create the automation** (when). It listens for new `company` records and starts a run of the playbook on each one: ```bash curl -X POST https://pod.example.com/api/hub/automations/create \ -H "Authorization: Bearer $SYNAP_API_KEY" \ -H "Content-Type: application/json" \ -d @research-new-companies.json ``` ```json title="research-new-companies.json" { "workspaceId": "", "name": "Research new companies", "triggerType": "event", "triggerConfig": { "eventPattern": "entity.create.completed", "filters": { "profileSlug": "company" } }, "status": "active", "flowDefinition": { "nodes": [ { "id": "trigger-1", "type": "trigger", "position": { "x": 0, "y": 0 }, "data": { "triggerType": "event", "label": "A company is added", "config": { "eventPattern": "entity.create.completed" } } }, { "id": "run-1", "type": "playbook_run", "position": { "x": 0, "y": 200 }, "data": { "label": "Research it", "playbookName": "Research a company" } } ], "edges": [{ "id": "e1", "source": "trigger-1", "target": "run-1" }] }, "metadata": { "dataContract": { "version": 1, "mode": "react", "gets": [ { "id": "new-company", "label": "A company is added to the pod", "nodeIds": ["trigger-1"], "origin": "synap", "event": "entity.create.completed" } ], "stores": [], "reacts": [ { "id": "research", "label": "Start a research session on it", "nodeIds": ["run-1"], "kind": "process" } ] } } } ``` The `dataContract` is required only when an agent creates the automation; it is harmless otherwise. Its `mode` must match its sections: `react` has `reacts` and no `stores`, `ingest` the opposite, `ingest_and_react` both. Every `nodeIds` entry must name a node of the flow. **Try it.** Add a company. The run's session is about the new record (the automation passes the record the event is about as the session's subject), and the agent working on it can use the capabilities your pod has, under the same governance as any other agent run. To call the search verb directly from the flow instead of leaving it to the agent, add a `capability` step with `verbId` set to the verb's name and an `inputMapping` such as `{ "query": "{{trigger.payload.data.title}}" }`. ## Related - [Capabilities](/docs/customize/capabilities) - [Validation policy](/docs/concepts/validation-policy) - [Event catalog](/docs/reference/events) - [Webhooks](/docs/build/webhooks), for the pod to call your URL when something changes # Capabilities > What a capability is, how to see what your pod has, install and run one from an app, an agent or the API, and make your own. URL: https://doc.synap.live/docs/customize/capabilities · Last reviewed against the code: 2026-11-03 A capability is something your pod can do: send an email from your account, search the web, publish a post, run a piece of code you wrote. Your agents, automations, apps and scripts ask the pod to do it; the pod runs it, with the credential it holds, under your governance. ## What a capability is made of A capability is a connection to one service plus the **verbs** that use it. A verb is one action with named inputs, such as `gmail_send` or `calendar_list`. Installing a capability creates its parts in your pod, in this order: | Part | What it is | |---|---| | **Secrets** | The credentials it needs, such as an API key. They are stored in your pod's vault. A verb uses the credential without ever seeing it. | | **Tools** | A connection to one service: where its API is and which credential it uses. | | **Verbs** | What it can do. Each verb is a skill of one of three runnable kinds: **declarative** (one HTTP call to the service, described as data, run by the pod), **code** (JavaScript run in the pod's sandbox, see [Run your own code](/docs/customize/runnable-code)) or **builtin** (an operation built into the pod). | A capability can also ask questions when you install it (for example "Your API key") and bring playbooks and automations that use its verbs. A verb's ID is its name: that is what you pass to run it. ## See what your pod has - **Pod admin console**: **Tools** lists everything installed on the pod (capabilities, instructions and code), and each row opens that tool's own page. **Marketplace** lists what you can install. Both are for the pod's owner and admins. - **CLI**: ```bash synap capability list # one row per capability: status, connection, verbs synap capability show # one capability in detail, with the next thing to do ``` - **Your agent**: `synap_list_capabilities` returns your connected services, each with its verbs and whether it is connected, plus standalone runnable skills. A verb that is installed but switched off is marked `blocked: "not_enabled"`, with a link for you to turn it on. - **API**: `GET /api/hub/capabilities` with a key that has the `hub-protocol.read` scope. See [Capabilities in the Hub REST API](/docs/reference/hub-api/capabilities). ## Install one Capabilities come from the [marketplace](/docs/customize/marketplace). From the CLI: ```bash # pick one from the catalog synap capability add # or name it; it asks for anything it needs, such as an API key synap capability add # sign in to the service, or give its credential synap capability connect # turn it on and choose which verbs it may run synap capability enable ``` A capability that is installed but not turned on cannot run: every run is refused until you enable it. A capability can hold several accounts for one service (`synap capability connections list `); a run uses the default one unless it names another. Your agent can install one too (ask it, for example, "find a capability for my calendar and propose installing it"). An agent's install is always a proposal (a **Request** in the apps) that you approve. From the API, `POST /api/hub/capabilities/apply` installs a catalog capability by its `templateKey` with its `params`, and needs the `hub-protocol.write` scope. When a person still has to answer a question or connect an account, it answers with what is missing (`missingFields`, or the connection to make). ## Run a verb | From | How | |---|---| | The CLI | `synap capability run -- `. `synap capability test ` previews it without running it. | | Your agent (MCP) | `synap_run_capability` with `verbId` and `parameters`. See [MCP tools](/docs/reference/mcp-tools). | | A script or a server with an API key | `POST /api/hub/capabilities/execute`, or `executeCapability` in `@synap-core/hub-rest-client` (below). | | An automation | A `capability` step in its flow. See [Automations and playbooks](/docs/customize/automations-and-playbooks). | | An app a person connects to their pod | The intent actions the pod offers it, with the person's consent. See [Build a website on your pod](/docs/build/build-a-website). | ```bash curl -X POST https://pod.example.com/api/hub/capabilities/execute \ -H "Authorization: Bearer $SYNAP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "verbId": "", "parameters": { "query": "…" } }' ``` The body takes `verbId` (or `skillId`), `parameters`, and optionally `workspaceId`, `connectionSelector` (which account to use) and `idempotencyKey` (so a retried send happens once). The key needs the `hub-protocol.write` scope. The answer is `200` with the result, or `202` with `status: "proposed"`, a `proposalId` and a `reviewUrl` when the run waits for your approval. ## What governance applies - **You run your own capability directly.** A person running a capability they own is not asked. - **An agent's run is checked.** A read-only verb runs. Any other verb runs when you granted it to that agent or a rule allows it; otherwise the run becomes a proposal you approve, and the agent gets `status: "proposed"` with a `reviewUrl`. This is a success, not an error. Running a verb is decided by these grants, not by the agent's write mode; records the verb writes back into your pod follow the write mode like any other agent write. - **"Never" holds.** When you set a rule that says never for an agent and a kind of action, its run is refused. - **Untrusted origin asks you.** A run started from an outside channel becomes a proposal even when it would otherwise run. - **A changed verb is switched off.** When what an approved verb runs changes (its code, the hosts it may reach, a tool it uses), it is turned off until a person approves it again. Applying a marketplace update you chose keeps it on. See [Validation policy](/docs/concepts/validation-policy) for the rules every write follows. ## Make your own From the smallest change to the largest: 1. **A new verb on a service you already connected**, with no code: ask your agent to add it. `synap_create_verb` describes one HTTP call on an installed tool (`method`, `pathTemplate`, `query`, `body`, `responseShape`, `parameters`), and the pod runs it. It cannot run code, and it cannot create a new connection. 2. **A verb that runs code**, when one HTTP call is not enough: a code skill. See [Run your own code](/docs/customize/runnable-code). 3. **A whole capability**: write a definition as JSON with at least a `key`, a `name`, its `tools` and its `skills` (and optionally `params`, `vault`, `provides`, `playbooks` and `automations`), then install it on your pod: ```bash synap capability create ./my-capability.json synap capability enable "" ``` `synap capability create` sends the definition to `POST /api/hub/capabilities/apply`. Parts that need your approval come back as proposals. 4. **Share it**: publish it to the marketplace as a capability package. See [Publish your own](/docs/customize/marketplace#publish-your-own). ## Related - [Marketplace](/docs/customize/marketplace) - [Automations and playbooks](/docs/customize/automations-and-playbooks) - [Run your own code](/docs/customize/runnable-code) - [API keys](/docs/build/api-keys) # Import your data > Every way to bring data into a pod (files, notes, connected accounts, webhooks and your own scripts) and which of them you review before anything lands. URL: https://doc.synap.live/docs/customize/import · Last reviewed against the code: 2026-11-03 Everything you bring in becomes records in your pod: notes, people, companies, files and the links between them. Pick the door that matches what you have: | You have | Use | You review it first? | |---|---|---| | Notes, Markdown, an Obsidian vault, a CSV, bookmarks | [`synap import`](#import-files-and-folders) or the import API | Yes: one preview for the whole batch | | A file to keep as it is (PDF, image, video, audio) | [`synap upload`](#upload-files) | Like any write: it applies, or comes back as a proposal | | A thought, a meeting note, a pasted text | [Capture](#capture-text) | When any part of it needs your approval | | Your calendar, contacts or email | [A connected account](#connected-accounts) | The first sync, once | | Events another service sends | [Webhooks in](#webhooks-in) | What the automation does is governed | | Anything else on your computer | [A script](#write-your-own-script) on the Hub REST API | Depends on the key | ## Import files and folders ```bash synap import ./notes # a folder synap import ./contacts.csv # a table synap import ./a.md ./b.md --dry-run # preview only, write nothing ``` What `synap import` does depends on what you give it: - **One file or one URL** goes through capture: it is read and structured into records. - **A CSV** is always imported as a table, even alone. - **Exactly two text files** (`.md`, `.markdown`, `.txt`, `.csv`) are imported as one batch. You see a preview and confirm it before anything is written (`--yes` confirms for you, `--dry-run` only previews). - **Three or more text files** run as a background job, so a large folder does not time out. There is no preview step and `--dry-run` does not apply: the result is one proposal (a **Request** in the apps) for the whole import, which you review and approve. `--job-status ` checks on a job later. Useful options: `--workspace` and `--project` choose where the records go, `--keep-raw` keeps the original file linked to the record it produced, and `--home-map "Projects=Builder"` sends paths containing `Projects` to the `Builder` workspace. ### Through the API The same import, from code, with a key that has the `hub-protocol.write` scope: 1. `POST /api/hub/import/analyze` with `userId` (yours, from `GET /api/hub/users/me`), `source` (`obsidian`, `markdown`, `csv` or `bookmark`) and `items` (1 to 2,000 of `{ "path", "content" }`), plus optionally `workspaceId`, `projectId` and `aiStructure: true` to have prose structured by AI. It returns the planned records and files them as one proposal. `previewOnly: true` returns the plan and files nothing. 2. Approve that proposal in the apps, or apply it with `POST /api/hub/import/apply` and its `proposalId`. Applying an import proposal is approving it, so an agent's key is refused there: an agent can prepare an import, and only a person can apply its proposal. For a large batch, `POST /api/hub/import/enqueue-corpus` returns a `jobId` at once; poll `GET /api/hub/import/corpus-job/{jobId}`. See [Import in the Hub REST API](/docs/reference/hub-api/import). ## Upload files ```bash synap upload ./contract.pdf synap upload ./photo.jpg --attach # attach it to an existing record synap upload ./talk.mp4 --title "Keynote" --workspace ``` Each upload becomes a `file` record (or the kind you pass with `--profile`) holding the stored file. Files up to 10 MB are sent directly; larger ones go straight to storage, up to 500 MB for video, 100 MB for audio and 200 MB for a zip archive. An agent stores a file with `synap_store_file` (up to 10 MB inline; it is stored as it is, never read), or asks for an upload URL first with `synap_request_upload` for a larger one. ## Capture text Capture turns free text into records: a meeting note becomes a person, a company, a task and the links between them. ```bash synap capture "Met Ada from Acme at the conference, she wants a demo in March" ``` An agent uses `synap_capture`: free `text` (up to 8,000 characters), or records it has already shaped (`entities`, `relations`, `documents`, `projects`, `sessions`). A capture lands all together or not at all: when every part of it may run directly under the agent's write mode it is written at once, and when any part needs your approval the whole capture becomes one proposal. When the AI that structures text is down, capture saves the text as a plain note and says so. ## Connected accounts Connect an account once, and the pod brings its data in: ```bash synap capability connect # pick a service to connect synap tools list # what is connected synap tools sync # sync now ``` Which services you can connect depends on your pod's connection service: `synap tools list` or `GET /api/hub/connectors/providers` lists them. For Google, the pod syncs calendar events, contacts and Gmail threads into records, merging the same person seen in several places into one. The first sync of an account arrives as **one** grouped proposal you review. Once you approve it, you can let that connection keep syncing: later syncs then apply directly. ## Webhooks in Another service (GitHub, a form tool, your own server) can post events to your pod, and an automation reacts to them. **Create a webhook source.** In the pod admin console, open the workspace and find **Webhook sources**. Give the source a name. You get its **Payload URL** and its **Secret**; the secret is shown once. Only a pod admin can create a source. **Point the service at it.** The service sends a `POST` to the payload URL, `https://pod.example.com/api/webhooks/inbound/`, signed with the secret: the header `X-Synap-Signature` or `X-Hub-Signature-256` carries `sha256=` followed by the hex HMAC-SHA256 of the raw body. GitHub signs this way already. The body may be up to 1 MB. A bad signature, an unknown source and a revoked source all get the same `401`. **React to it.** Create an automation with a `webhook` trigger that names the source: `"triggerConfig": { "webhookSource": { "name": "" } }`. Each delivery runs it with `trigger.payload.data.payload` set to the body the service sent. See [Automations and playbooks](/docs/customize/automations-and-playbooks). Each delivery is stored before the pod answers `200`, so a delivery the automation could not process right away is retried by the pod. A redelivery with the same delivery ID (`X-Synap-Delivery-Id` or `X-GitHub-Delivery`) is stored and runs once. A `ping` event is acknowledged and runs nothing. This is the opposite direction from [Webhooks](/docs/build/webhooks), where your pod calls your URL. ## Write your own script When your data sits somewhere none of the doors above reads (an export from another app, a folder in your own format, a database on your computer), write a script that reads it and creates records through the [Hub REST API](/docs/reference/hub-api). Create an [API key](/docs/build/api-keys) with the `hub-protocol.write` scope for it. This Node.js script creates a note for each Markdown file in a folder, using [`@synap-core/hub-rest-client`](https://www.npmjs.com/package/@synap-core/hub-rest-client): ```bash npm install @synap-core/hub-rest-client ``` ```js title="import-notes.mjs" import { readdir, readFile } from "node:fs/promises"; import { join, basename } from "node:path"; import { HubRestClient } from "@synap-core/hub-rest-client"; const hub = new HubRestClient({ podUrl: process.env.SYNAP_POD_URL, // https://pod.example.com apiKey: process.env.SYNAP_API_KEY, }); const folder = process.argv[2]; for (const name of await readdir(folder)) { if (!name.endsWith(".md")) continue; const content = await readFile(join(folder, name), "utf8"); const result = await hub.createEntity({ profileSlug: "note", title: basename(name, ".md"), content, // Markdown, stored as the note's document workspaceId: process.env.SYNAP_WORKSPACE_ID, }); if (result.status === "proposed") { console.log(`${name}: waiting for your approval ${result.reviewUrl ?? ""}`); } else { console.log(`${name}: created ${result.id}`); } } ``` ```bash SYNAP_POD_URL=https://pod.example.com SYNAP_API_KEY=... SYNAP_WORKSPACE_ID= node import-notes.mjs ./notes ``` `createEntity` calls `POST /api/hub/entities`. It answers `200` with `status: "created"` when the record is written, or `202` with `status: "proposed"` and a `reviewUrl` when it waits for your approval; the client throws on an error status. To import many records as one reviewable batch instead of one by one, send them to `POST /api/hub/import/analyze` (above). From another language, call the same routes over HTTP with `Authorization: Bearer `. ## What is reviewed and what lands The same rules apply to every door. In short: - **You, with your own key or in the apps**: your writes apply directly, except an import batch, which you confirm first, and the first sync of a connected account. - **An agent**: what happens depends on its write mode. Creates and edits apply directly with Undo in the default mode; structural changes, deletions and anything that came from outside the pod become proposals. An agent can never apply an import proposal or approve its own. - **A webhook or a schedule** running an automation: every write its steps make goes through the same governance. See [Validation policy](/docs/concepts/validation-policy) for the full rules. # Make it yours > Every way to shape a pod to your work, from installing a template to writing your own app, and who does each. URL: https://doc.synap.live/docs/customize · Last reviewed against the code: 2026-11-03 A pod starts with general kinds of records (people, companies, tasks, notes and so on). Everything else is added, and almost all of it is configuration stored in the pod, not code: a workspace (a space in the apps), a kind, a field, a view, an automation. So you, your agent and a template can all change it through the same doors, under the same review. Three kinds of actor make these changes: - **You, in an app**: the Browser app on the desktop, or the marketplace on [synap.live](https://www.synap.live/marketplace). - **Your agent, through MCP**: you ask in plain language, and the structural changes it makes become proposals (requests in the apps) you approve. - **Code**: the `synap` CLI, a script on the Hub REST API, or an app on the SDK. ## The extension points Ordered from no code to code. | You want to… | What it changes | Who does it | |---|---|---| | [Install a space from a template](/docs/customize/spaces-and-templates) | Adds a whole domain (a CRM, a content studio, finance): its kinds, fields, views, playbooks (templates in the apps) and automations | You in the Browser app or on synap.live, the CLI, or your agent | | [Add kinds, roles and fields](/docs/customize/kinds-and-fields) | Your data model: a new kind of record, a role an existing record can play, a field, a lifecycle | Your agent through MCP, or a template | | Add a [view](/docs/concepts/views) | How a set of records is shown (board, table, calendar, graph…). The records do not move | Your agent (`synap_create_view`), the CLI (`synap view create`), or a template | | [Install from the marketplace](/docs/customize/marketplace) | Adds packages others published: workspaces, capabilities, skills, automations, views, cards | You in an app, the CLI, or your agent | | [Add capabilities](/docs/customize/capabilities) | The tools your agents can call, such as an email or calendar account | You, the CLI, or your agent | | [Automate with playbooks and automations](/docs/customize/automations-and-playbooks) | Repeatable work: a shape of session (a job in the apps) you can run again, bound to a trigger | You, the CLI, or your agent | | [Import your data](/docs/customize/import) | Brings records from other tools into your pod | You or the CLI | | [Run your own code](/docs/customize/runnable-code) | Code that runs with your pod, such as a card that renders a record your way | Code | | Build your own [app or website](/docs/build) | A product of your own on top of your pod, through the SDK or the Hub REST API | Code | | Bring [your own agent](/docs/agents) | Which AI works on your pod, with its own key and identity | You, with `synap connect` or `synap agents add` | ## Rules that hold for every extension - **Agents propose structural changes.** An agent defining a kind or a role, creating a workspace, playbook, automation or card, or installing a package always files a proposal you approve, and no rule can change that. Adding a field is a proposal by default. Plain record creates and edits are different: by default they apply directly, with Undo. A person defining a kind or creating a workspace is not affected, but retiring a field or declaring a lifecycle is a proposal for anyone. See [Validation policy](/docs/concepts/validation-policy). - **One workspace per domain.** A domain is installed once; a project is a filter across workspaces, never a second copy of one. See [Spaces and templates](/docs/customize/spaces-and-templates#one-space-per-domain). - **Installing adds.** A package is refused when it would overwrite something your pod already has under the same name. See [Marketplace listing policy](/docs/community/marketplace-policy). - **Records stay put.** A view is a projection and a workspace is a lens: neither copies your records. ## In this section # Kinds, roles and fields > Add a new kind of record, a role an existing record can play, a field or a lifecycle, through your agent or in a template. URL: https://doc.synap.live/docs/customize/kinds-and-fields · Last reviewed against the code: 2026-11-03 Your pod's data model is configuration you can extend: new kinds of records, new roles, new fields and the stages a record moves through. This page is the how. For the why, read [Kind and facets](/docs/concepts/kind-and-facets) and [Profile schemas](/docs/concepts/profile-schemas). ## Pick the right shape Before you add anything, check what exists: ask your agent to list the kinds and roles (`synap_list_profiles`), or run `synap list profiles`. Then pick the smallest change that fits: | You want to record… | Add | Example | |---|---|---| | A new kind of thing, with its own identity and fields | A **kind** | `episode`, `property`, `grant-application` | | A context an existing thing is in | A **role** on the existing kind, never a second kind | A `person` who is a `mentor`; a `company` that is a `supplier` | | One more piece of information on a kind you already have | A **field** on that kind | `episode-number` on `episode` | | A field only one workspace (a space in the apps) should see | A **workspace overlay** field | A deal-size field on `person`, in the CRM workspace only | | The stages a record moves through | A **lifecycle** on the kind or role | `idea` → `recording` → `published` | If the thing could outlive the record it belongs to, or have relations of its own, it is a kind; if it only changes how an existing record is seen, it is a role. ## Through your agent Your agent changes the data model with MCP tools. A new agent key lists a small set of tools at first and loads the others in groups with `synap_load_skill`: the data model tools are in `tools:schema`, `synap_list_profiles` in `tools:read` and `synap_attach_facet` in `tools:data`. Ask in plain language, for example: > "I want to track podcast episodes, each with a number and a recording date. Propose the kind." The agent then uses these tools: | Tool | What it does | |---|---| | `synap_define_kind` | Creates a kind with its fields in one proposal (a request in the apps). Called again with an existing slug, it adds only the fields that are not there yet, which is how you add a field to any kind. A field takes a `valueType` (`string`, `number`, `boolean`, `date`, `entity_id`, `array`, `object` or `secret`), optional `constraints` (for example the allowed values, as an `enum`), `defaultValue` and `required`, and `overlay: true` to make it a workspace overlay. To allow more values on an existing field, the agent sends its `enum` again with the new values added | | `synap_define_role` | Creates a role and the kinds it can attach to (`applicableKinds`), or widens an existing role to more kinds | | `synap_attach_facet` | Gives an existing record a role. The CLI equivalent is `synap facet attach ` | | `synap_declare_lifecycle` | Gives an existing kind or role a lifecycle (see below) | | `synap_change_kind_scope`, `synap_grant_profile_access` | Changes which workspaces see a kind, instead of creating a twin of it in another workspace | | `synap_retire_field` | Proposes removing a field. Refused while records still hold values in it | When an agent makes these changes, they come back as **proposals**: - defining a kind or a role always files a proposal, and no rule can change that; - adding a field to an existing kind is a proposal by default, unless a rule lets that agent add fields directly; - retiring a field and declaring a lifecycle always file a proposal, whoever asks, a person included. A proposal is not a failure: approve it in the Browser app (or Relay, in beta). For a new kind, one approval creates the kind and the fields it was proposed with. A person defining a kind or a field is not subject to the first two rules. Records of a new kind are pod-wide by default; `entityScope: workspace` keeps them in one workspace, for a kind that belongs to one app only. Slugs are stored in lowercase words joined by `-`: `botScore` becomes `botscore`, `social_account_audit` becomes `social-account-audit`. Use the stored slug afterwards. ## Declare a lifecycle A lifecycle is the list of stages a record of a kind or role moves through. Each option has a stored `key` and a **category** that tells every app and agent what the stage means: | Category | Means | |---|---| | `open` | Not started | | `active` | In progress | | `paused` | On hold | | `done` | Finished well | | `lost` | Dropped, or will not happen | An option can also have a `label` (the words people read; the `key` never changes), `humanOnly: true` (only a person can move a record into it), and `stuckAfterDays` (for open, active and paused options: after how many days a record in it counts as stuck). Every status change then goes through the pod's one status door. With `synap_declare_lifecycle`, your agent proposes a lifecycle for an existing kind; its field is `status` unless you name another one. Existing records keep the status they have until they are moved. It is refused when the kind already has a lifecycle, or when records hold a value no option names. `synap_declare_lifecycle` is on the backend's main branch and not yet in a tagged release (v1.2.8 does not have it). If your agent does not list it after loading `tools:schema`, declare the lifecycle in a template instead (next section). ## In a template A workspace template declares kinds, roles, fields and lifecycles under `profiles`, and installing it creates them. This is how to ship a data model to others, or to several pods. A minimal example: ```yaml meta: slug: podcast-studio name: Podcast Studio description: Plan, record and publish podcast episodes. icon: mic color: "#6B7280" workspace: name: Podcast Studio description: Plan, record and publish podcast episodes. profiles: - slug: episode displayName: Episode properties: - slug: episode-number label: Episode number valueType: number - slug: recorded-on label: Recorded on valueType: date - slug: status label: Status valueType: string lifecycle: property: status options: - { key: idea, category: open } - { key: recording, category: active, stuckAfterDays: 14 } - { key: published, category: done, humanOnly: true } - { key: dropped, category: lost } ``` A role is a profile with `profileKind: role` and the kinds it attaches to in `applicableKinds`, for example `[company, person]`. A template that uses a kind your pod already has (such as `person`) reuses it and adds its own fields as overlays for its workspace. Start a file with `synap market scaffold `, check it with `synap market validate `, then install or publish it as described in [Marketplace](/docs/customize/marketplace#publish-your-own). ## Related - [Kind and facets](/docs/concepts/kind-and-facets): why a role is not a second record. - [Profile schemas](/docs/concepts/profile-schemas): how base fields and workspace overlays layer. - [Entity connections](/docs/concepts/entity-connections): relations between records. - [MCP tools](/docs/reference/mcp-tools): every tool's parameters. # Marketplace > Find, install and update packages for your pod, and publish your own, from the web, the Browser app, the CLI or your agent. URL: https://doc.synap.live/docs/customize/marketplace · Last reviewed against the code: 2026-11-03 The marketplace is the catalog of packages you can add to a pod: made by Synap and by the people who use it. The catalog lives on the Synap Control Plane; installing always happens on your pod, under your pod's governance. Browse it on the web at [synap.live/marketplace](https://www.synap.live/marketplace). ## What you can install | Package | What installing it gives you | |---|---| | **Workspace** (a space in the apps) | A complete domain: kinds of records, fields, views, playbooks (templates in the apps) and automations. See [Spaces and templates](/docs/customize/spaces-and-templates). | | **Project template** | Several workspaces at once, for one intent ("run an agency"). It is a workspace package tagged `suite`. | | **Capability** | Tools your agents can call, such as an email or calendar account. See [Capabilities](/docs/customize/capabilities). | | **Skill** | Instructions that teach an agent a job. See [Agent skills](/docs/agents/skills). | | **Automation** | A triggered, repeatable process. The catalog calls this package type `workflow`. See [Automations and playbooks](/docs/customize/automations-and-playbooks). | | **View** | A new way to look at records, such as a board or a dashboard. See [Views](/docs/concepts/views). | | **Card** | How a record renders. The catalog calls this package type `cell`. | ## Browse and install ### On the web On [synap.live/marketplace](https://www.synap.live/marketplace), search or pick a kind of package. Signed in with your Synap account, you can install a workspace or project template into one of your pods with **Install**. For every package, **Other ways to install** offers to open the install in the Synap app or gives you the CLI command. ### In the Browser app Open the **Marketplace** to find and install packages into the pod you are signed in to. A package that needs your approval waits as a proposal (a request in the apps): approve it in the Browser app (or [Relay](/docs/use/relay), in beta). ### From the CLI ```bash # list everything you can install synap market # one package type: workspace, capability, skill, workflow, view, cell synap market --type capability # search names, descriptions and slugs synap market --search calendar # install one package synap market install ``` What `install` does depends on the package type: - A **workspace** is provisioned on your pod. `--dry-run` previews it without writing anything, `--onto ` adds it to a workspace you already have, and `--project ` tags what it creates to a project. - A **capability** installs through the same path as `synap capability add`, and asks for any credential it needs. Run it interactively. - An **automation** or a **view** is added to a workspace: pass `--workspace `, or set a default with `synap use `. - A **card** or a **skill** lands pod-wide. Without `synap login`, `synap market` lists public packages. Signed in, it also lists your own private packages. ### From your agent Your agent searches with the pod's `market.search` verb and installs with `market.install`, both run through `synap_run_capability`. `market.search` reads the copy of the catalog your pod keeps. An agent's install is always a proposal you approve: ask in plain language, for example "find a capability for my calendar and propose installing it". An agent connected through the Synap Cloud connector (`https://mcp.synap.live`, set up for claude.ai by `synap mcp connect-claude`) also has `market_search`, which searches the catalog on the Control Plane before any pod is chosen. ## What your pod checks Every install goes through the pod, whoever starts it: - A package only adds. It is refused when it would overwrite something your pod already has under the same name. - An install by an agent becomes a proposal; an agent cannot approve it. - A package that needs a paid plan is refused early when your pod's plan does not cover it. - Updates to installed packages are not applied automatically: you run them (below). Your pod reads Synap's catalog from the Control Plane every 10 minutes. A pod admin can add other catalogs (sources) and set how far each is trusted, and the operator of a self-hosted pod can switch Synap's catalog off. See [Marketplace listing policy](/docs/community/marketplace-policy) and [Self-hosted pod or Synap Cloud](/docs/use/cloud-vs-self-hosted#what-a-self-hosted-pod-still-contacts). ## See what is installed and update it ```bash # packages installed on this pod synap market installed # only those with an update available synap market installed --outdated # preview the updates available; applies nothing synap market update # update one synap market update # apply every available update, agreeing to the data changes it lists synap market update --yes ``` For workspaces, `synap templates` shows every workspace with its template status and `synap templates update` applies updates. An update that changes existing data waits for a person to agree. See [Spaces and templates](/docs/customize/spaces-and-templates#keep-a-space-in-step-with-its-template). ## Publish your own Publishing uses your Synap account, not your pod's keys: approval and publication stay with a person. **Sign in and create your publisher profile**, once, before your first publish. Packages are attributed to it. ```bash synap login synap vendor create --name "Your studio" ``` **Write the package.** Start from a minimal valid file, or from a workspace you already built: ```bash # writes .template.yaml, a workspace template synap market scaffold # or a cell, view, workflow, capability or skill package synap market scaffold --kind view # check it synap market validate .template.yaml ``` **Publish it.** A package is private by default. ```bash # from a file synap market publish .template.yaml # turn a live workspace into a template synap market publish --from-workspace # turn a project's workspaces into a project template synap market publish --from-project ``` Publishing the same slug again updates your package; publishing identical content changes nothing. A private package stays installable by its slug for you. A package from a publisher other than Synap is listed publicly only after Synap reviews it: until then `--public` is refused, with that reason. `synap market unpublish ` makes a package private again. An agent on the Synap Cloud connector can publish with `market_publish`, under the same rules. A slug that Synap already publishes as an official package of the same type is refused for anyone else. What Synap requires of a listed package is in the [Marketplace listing policy](/docs/community/marketplace-policy). # Run your own code > Add code your pod can run when no capability does what you need (a code skill, a script on your own computer, or a card in the apps), how each is sandboxed and approved, and how agents, apps and scripts call it. URL: https://doc.synap.live/docs/customize/runnable-code · Last reviewed against the code: 2026-11-03 When no [capability](/docs/customize/capabilities) does what you need, you or your agent can add code. There are three places code runs. Each is sandboxed, and by default code an agent adds waits for your approval before it runs. Once approved, your code can be run by your agents (over MCP), by the CLI, by your automations, and by any script or website **server** that holds an API key for your pod. A page in a visitor's browser, or an app a person connects to their pod, cannot run it: see [Call your code from elsewhere](#call-your-code-from-elsewhere). | You want | Add | Where it runs | |---|---|---| | Logic over your data or an API: compute, filter, call a service, write records back | A **code skill** (JavaScript) | In your pod's sandbox | | A program with packages, files or Python: convert a file, chart a CSV, scrape a page | A **box script** (Python or Node.js) | On a computer of yours, in a fresh box per run | | Records shown your way: a card, a chart, a board | A **cell** (a card in the apps) | In the Synap apps, in a sandboxed frame | For a single HTTP call on a service you already connected, you need no code: add a declarative verb instead (see [Make your own capability](/docs/customize/capabilities#make-your-own)). ## Code skills A code skill is a verb whose body is JavaScript. Once approved, it shows up next to your other verbs, and everything that can run a verb can run it. ### What the code is Your code is the body of an async function. The pod runs it as: ```js (async function (args, context) { /* your code */ })(args, context); ``` - `args` holds the inputs of the run, shaped by the skill's `parameters` (for example `{ "days": "number?" }`). - `context` holds `userId`, `workspaceId` and `agentUserId`. - What you `return` (JSON) is the run's result. `await` works at the top level. The code has the JavaScript built-ins plus `URL`, `URLSearchParams`, `TextEncoder`, `TextDecoder`, `btoa`, `atob` and `structuredClone`. There is no `fetch`, `require`, `process` or `Buffer`: code that uses a name the sandbox does not provide is refused when it is saved. It reaches the outside only through what the pod hands it: | In the code | Does | |---|---| | `hubProtocol.getEntities({ profileSlug, limit })`, `hubProtocol.search(query, opts)`, `hubProtocol.getDocument(id)` | Read your pod, as you | | `propose.entity({ profileSlug, title, properties, … })` | Write a record back, through the same governance as any agent write | | `callProvider(tool, method, path, body)` | Call a connected service's API with its stored credential. The code never sees the key. | | `secrets.get("vault://…")` | Read a secret you granted it | | `host.fetch(url, opts)` | Reach a host on the skill's approved `allowedHosts` list (declared in a capability definition); every other host is refused | ### Example This skill lists your overdue tasks. It reads only your pod: ```js const tasks = await hubProtocol.getEntities({ profileSlug: "task", limit: 100 }); const today = new Date().toISOString().slice(0, 10); const overdue = tasks.filter( (t) => t.properties?.dueDate && String(t.properties.dueDate).slice(0, 10) < today, ); return { count: overdue.length, titles: overdue.map((t) => t.title) }; ``` ### Add one - **Ask your agent.** It calls `synap_create_skill` with a `name`, a `description`, the `code`, a `body` explaining the skill, and its `parameters`. When the code calls a connected service, it lists that tool in `requiredTools`, so you approve the tool together with the skill. `timeoutSeconds` is 30 by default, at most 300. - **The API**: `POST /api/hub/skills`. See [Skills in the Hub REST API](/docs/reference/hub-api/skills). - **Inside a capability**, as a verb of `kind: "code"`, so it installs with the connection it needs. See [Capabilities](/docs/customize/capabilities#make-your-own). To fix a skill, change it in place (`synap_update_skill`), never create a second one under the same name. ### Approval A code skill runs only while it is turned on: - An agent's new skill comes back as a proposal (a **Request** in the apps), whatever its write mode: creating a skill adds something that can act, so it is never one of the undoable writes an agent may make directly. The review shows its whole code, the services and hosts it can reach; approving it also turns it on. - If you add a rule that lets an agent create skills without asking, a skill whose code reaches nothing outside your pod (no hosts, no connected tools, no `callProvider`) starts turned on. Any other skill starts off, and the pod asks you once whether to turn it on. - A code skill created through the API by a person starts turned off. Turn it on with `POST /api/hub/skills/{id}/approve` and `{ "approved": true }`, with a person's key: an agent's key is refused. - Changing what a skill runs (its code, parameters, timeout, the hosts it may reach, or a tool added to it) turns it off until a person approves it again. `synap_list_capabilities` then shows it as `blocked: "not_enabled"`, with a link to turn it on. ### How it is isolated Each run happens in a V8 isolate (`isolated-vm`) with 64 MB of memory and the skill's timeout, inside a separate worker process the pod supervises, started with Node.js's permission model and read-only file access. A code skill never runs inside the pod's API process; a pod in production refuses to. ## Box scripts (advanced) A box script is a whole program in Python or Node.js, with packages, run on a computer of yours, never on the pod. Each run gets a fresh box with no access to your pod and no secrets; its network reaches only the package registries (while installing) and the hosts the script declared. Your agent writes one with `synap_create_skill` and `executionMode: "box"`, the program in `code`, and `box: { language: "python" | "node", packages: [{ name, version }], hosts: [...] }`. Packages are pinned to an exact version. The script reads its inputs from `/in/parameters.json` and writes files to `/out`; they come back with the run, with its log and exit code. The reviewer approves the code, the packages and the hosts together. A run is queued (`status: "queued"` with a `boxRunId`) until a computer picks it up. For that, one of your computers runs `synap box serve`, and you turn on **Runs scripts** for it in the pod admin console, under **Computers**. Otherwise the run is refused and says why. `synap box serve` creates each box as a fresh unprivileged LXC container on a Proxmox host, and destroys it after the run. Preparing that host is not covered in these docs yet. ## Cells A cell is UI code that renders records: a card for one kind, a chart, a board. It runs in the Synap apps, not on the pod. ```bash # one module, packages included synap cell build ./deal-card.tsx --out ./dist/deal-card.js --bundle-deps # send it to the pod synap cell define --name "Deal card" --file ./dist/deal-card.js ``` `synap cell build --define` does both in one step. Bundle every dependency: a cell that asks for packages at run time fails to load. Your agent defines one with `synap_create_cell` (always a proposal), then binds it as how a kind renders (`list`, `detail`, `card` or `dashboard`) with `synap_promote_cell_to_renderer`. The cell runs in a sandboxed frame with no access to the app's origin, cookies or storage, and no pod key. It runs only its own bundled code, can contact only hosts that a package you installed declared, and reads and writes your pod by messages to the app, which allows a fixed set of operations. ## Call your code from elsewhere Once approved, a code skill or a box script runs like any verb: | From | How | |---|---| | Your agent (MCP) | `synap_list_capabilities` lists it; `synap_run_capability` runs it, by its name (`verbId`) or `skillId`, with `parameters` | | The CLI | `synap capability run -- ` | | An automation | A `skill` or `capability` step | | A script, or your website's server, with an API key | `POST /api/hub/capabilities/execute` with `skillId` or `verbId` and `parameters` (scope `hub-protocol.write`), or `POST /api/external/skills/{id}/invoke` with `{ "input": { … } }` (scope `skills.invoke`) | When an agent runs it, the same rules as any verb apply: it can come back as a proposal you approve. See [Capabilities](/docs/customize/capabilities#what-governance-applies). What is not possible today: - **An app a person connects to their pod** (built on `@synap-core/sdk/connect`, see [Build a website on your pod](/docs/build/build-a-website)) cannot run your own skills. It reaches only the actions the pod offers for an intent, such as "publish a post", and those come from Synap's official capabilities. - **A public website** with no key cannot run code on your pod. - **An automation step cannot hold code.** Its `condition`, `transform` and `compute` steps take expressions; put code in a skill and call it from a `skill` step. ## Related - [Capabilities](/docs/customize/capabilities) - [Automations and playbooks](/docs/customize/automations-and-playbooks) - [Skill invocation](/docs/build/skill-invocation) - [API keys](/docs/build/api-keys) # Spaces and templates > What a space is, what a space template brings, and how to install one from the apps, the CLI or your agent. URL: https://doc.synap.live/docs/customize/spaces-and-templates · Last reviewed against the code: 2026-11-03 A **space** is one domain of your work inside your pod: sales, content, finance, research. The API, the CLI and the agent tools call it a **workspace** (`workspaceId`, `synap_create_workspace`). A **template** sets up a space in a single install, with the kinds of records, fields, views and playbooks (templates in the apps) that the domain needs. ## What a space is A space is a lens on your records, not a container that copies them. Most kinds are pod-wide: a person is stored once, and every space that uses people sees the same record. What a space adds is its own view of them: - its own fields on shared kinds (a CRM space can add a deal stage to people without other spaces seeing it; see [Profile schemas](/docs/concepts/profile-schemas)), - its own roles (a person is a `client` in your CRM space; see [Kind and facets](/docs/concepts/kind-and-facets)), - its own kinds, views, playbooks, automations and members. ## One space per domain A domain is installed once. A **project** is a filter across spaces, never a reason for a second copy of one. "Content for client X" is the Content space filtered by the project X, not a second Content space. To work on a domain for a project: 1. File the records into the project. Your agent does it with `synap_file_into_project`. 2. Link the project to the space. Your agent does it with `synap_project_use_workspace`. Installing a template with a project (`--project ` on the CLI) links them for you. The pod enforces this for every caller, person or agent: - No two active spaces share a name or a template. - A template is installed once per pod. Installing it again reuses the space it already made. - A request to create a second space for a domain that already has one gets that space back, with the reason. ## What a template contains A template is a file (YAML in Synap's own catalog) with a `meta` header and a body. The parts you are likely to meet: | Part | What it brings | |---|---| | `workspace` | The space's name and description | | `profiles` | Kinds and roles, with their fields and, where they have one, their lifecycle (the stages a record moves through) | | `entityLinks`, `relationDefs` | The relation types records can be linked with | | `views`, `layout`, `bento` | The views and the space's home | | `playbooks`, `automations` | Repeatable work and the triggers that start it | | `integrations` | Capabilities (tools and connectors) to install with it | | `skills` | Skills linked to the space, so every agent working there is told about them | | `rules` | Rules it installs in the space. A later template update never overwrites a rule you edited | | `onboarding`, `seedEntities` | The context of the space's first-run interview, and initial records | | `dependencies` | Other templates it needs, installed first. CRM, for example, requires Strategy (`foundation`), which defines the shared `client`, `partner` and `lead` roles | A **project template** installs several spaces at once. On the marketplace it is a workspace package tagged `suite`, whose dependencies are the spaces it installs. Installing a template only adds. It reuses kinds your pod already has (adding its own fields to them as overlays) and is refused when it would overwrite something under the same name. ## Install a template Browse the current templates first: the catalog changes, so this page does not list them. Examples include CRM, Content OS, Finance, HR, Legal and Research. ### From the apps - **On the web**: [synap.live/marketplace](https://www.synap.live/marketplace). Sign in with your Synap account, open a space or project template and choose **Install** to install it into one of your pods. The same page offers to open the install in the Synap app, or gives you the `synap market install` command. - **In the Browser app**: open the **Marketplace** to find and install spaces, views and add-ons into the pod you are signed in to. If the install needs your approval, it waits as a proposal (a request in the apps); approve it in the Browser app (or Relay, in beta) app. ### From the CLI ```bash # browse space templates synap market --type workspace # search by name, description or slug synap market --search crm # preview: what it would create, reuse or conflict with; writes nothing synap market install crm --dry-run # install synap market install crm # install and tag what it creates to a project synap market install crm --project ``` `--onto ` installs a template onto a space you already have, adding what is missing, instead of creating a new one. `--dry-run` works for space templates only. To start a new company or operating system on an empty pod, `synap launch` creates a project and its core spaces, interactively; `synap launch --list` shows what it can set up. ### From your agent Your agent searches the marketplace with the pod's `market.search` verb and installs with `market.install`, both run through `synap_run_capability`. An install by an agent always becomes a proposal you approve, and so does an agent creating a space without a template (`synap_create_workspace`). Ask it in plain language, for example: "Find a template for running a podcast and propose installing it." An agent connected through the Synap Cloud connector (`https://mcp.synap.live`, what `synap mcp connect-claude` sets up for claude.ai) can also search the catalog with `market_search` before it picks a pod. ## Keep a space in step with its template Templates get new versions. Your space records which template and version it was installed from. ```bash # every space: attached, drifted or unattached synap templates # preview the available updates synap templates update # apply one synap templates update crm # apply every available update synap templates update all # connect a space made before it had a template; suggests one synap templates attach "Sales" ``` An update that changes existing data lists each change and waits for a person to agree. `--yes` agrees to every change it lists; `--accept-data-changes ` agrees to exactly the ones you name from the preview. Some data changes need a pod owner or admin. An agent can check where each space stands with `synap_template_health`, but it cannot agree to a data change for you: run with an agent's key, an update becomes a proposal. When Synap retires a template in favour of another, `synap templates retire ` moves the space's records into the replacement's space. It shows the plan and asks first, and it never deletes. ## Make your own template Build the space the way you want it, then publish it as a template with `synap market publish --from-workspace `, or write the file yourself. See [Marketplace](/docs/customize/marketplace#publish-your-own). ## Related - [Kinds, roles and fields](/docs/customize/kinds-and-fields): change the data model of a space after install. - [Marketplace](/docs/customize/marketplace): everything else you can install. - [Profile schemas](/docs/concepts/profile-schemas): how a space's fields layer over shared kinds. # Reference > Lookup pages for the CLI, the MCP tools, the event catalog and the Hub REST API, generated from source. URL: https://doc.synap.live/docs/reference · Last reviewed against the code: 2026-10-20 The reference pages are generated from the source repositories, not written by hand. Each one says which repository and commit it was generated from. The source repositories export the data as JSON; `scripts/sync-reference.mjs` in this site's repository copies it and `scripts/generate-reference.mjs` turns it into these pages. ## The reference pages ## Where each one comes from | Reference | Generated from | Here | |---|---|---| | CLI (`@synap-core/cli`) | The command definitions in the `synap-cli` repository (`docs/reference/cli.json`) | [CLI](/docs/reference/cli) | | MCP tools | The tool definitions in the backend repository (`docs/reference/mcp-tools.json`) | [MCP tools](/docs/reference/mcp-tools) | | Events | `packages/events` in the backend repository (`docs/reference/events.json`) | [Event catalog](/docs/reference/events) | | Hub REST API | The OpenAPI description every pod serves at `/api/hub/openapi.json` (`docs/reference/hub-openapi.json`) | [Hub REST API](/docs/reference/hub-api) | Two references are not generated yet: | Reference | Source of truth | Here | |---|---|---| | Pod configuration | `deploy/env.schema` in the backend repository | [Configuration](/docs/run/configuration) | | Server CLI (`synap` on a pod host) | `synap help` and `synap --help` on the server | [Run](/docs/run) | # Backups and restore > Where a pod's data lives, the backups it takes on its own, off-host snapshots, and how to restore. URL: https://doc.synap.live/docs/run/backups · Last reviewed against the code: 2026-10-20 A pod backs itself up to its own disk every hour. That protects you from mistakes with Docker, not from losing the server. Set up **off-host** snapshots as soon as the pod holds anything you care about. All commands run from the deploy directory: ```bash cd /opt/synap/deploy ``` ## Where the data lives | Data | Where | Survives `docker compose down -v`? | |---|---|---| | PostgreSQL (your data, and Kratos accounts) | Docker volume `_postgres_data` | No. That is why the dumps exist. | | Hourly dumps | `deploy/backups/postgres/-auto/.dump` on the host | Yes | | Pre-update and manual dumps | `deploy/backups/postgres/-pre-update/…` and `-