{
  "name": "Palbase Public API Specifications",
  "docs": "https://palbase.studio/docs",
  "llms": "https://palbase.studio/llms.txt",
  "specs": [
    {
      "module": "ai",
      "title": "Palbase ai",
      "description": "Palbase's ai module: a project's use of models — an answer, a typed JSON document, a stream of either, a response finished in the background, vectors of texts and pictures — with what each use cost and the project's own provider keys. The models are the platform's: no machine is configured and none is opened for this work.",
      "version": "1.0.0",
      "paths": 114,
      "url": "https://palbase.studio/openapi/ai.openapi.json"
    },
    {
      "module": "analytics",
      "title": "Palbase Analytics",
      "description": "Palbase's analytics module: what a project's apps send — product events (captures, identifies, aliases, screens, page views), performance samples, request traces, console history — and what the project's server reads back: summaries, event lists, funnels, retention tables, requests, performance percentiles, console records. One shared, multi-tenant service: every project's rows are in shared tables of a replicated ClickHouse, and a row policy lets a read see only the project it names.\n\nTwo doors. A client app sends with the publishable key, and a signed-in user's token makes what it sends theirs. The project's server reads and changes its settings with its secret key (`apikey`, role `service_role`).\n\nWhat an app sends is limited per project per second (all kinds together), and kept as long as the project's retention says (90 days for events, samples and traces, 14 for console records, unless changed). Places (country, region, city) are resolved with DB-IP's IP to City Lite database: IP geolocation by DB-IP (https://db-ip.com), CC BY 4.0.",
      "version": "1.0.0",
      "paths": 38,
      "url": "https://palbase.studio/openapi/analytics.openapi.json"
    },
    {
      "module": "auth",
      "title": "Palbase Auth API",
      "description": "Palbase's authentication module: one shared, multi-tenant service; every\nproject is isolated by row security in its database.\n\nClients reach it at their project's address, `https://<ref>.<domain>`,\nthrough the Palbase edge. The edge resolves the project from the host,\nchecks the API key (`apikey` header: the publishable key is role `anon`,\nthe secret key is role `service_role`), verifies a user's access token\nwhen one is sent, and forwards a signed edge identity the service\ntrusts. A client never sends that identity itself.\n\n## Security schemes\n\n- `ApiKeyAuth` — the project's publishable or secret key. Every route except\n  `/.well-known/*`, the OAuth provider callbacks and the browser steps of\n  `/oauth/authorize` requires one.\n- `AdminAuth` — the secret key; required on every `/admin/*` route.\n- `userJWT` — the user's access token, sent as `Authorization: Bearer …`\n  alongside the API key, on `/auth/*` routes that act on the signed-in\n  user.\n",
      "version": "0.1.0",
      "paths": 171,
      "url": "https://palbase.studio/openapi/auth.openapi.json"
    },
    {
      "module": "cache",
      "title": "Palbase Cache",
      "description": "Palbase's cache module: a project's short-lived entries — a value a server computed and wants again — in one shared, multi-tenant service on a Valkey of its own. The project is the one the key was issued for: no request names a project, and no project reaches another's entries.\n\nOnly the project's secret key reads and writes the cache (`apikey` header, role `service_role`; a machine's own key is one), without a user's token beside it. A publishable key ships in apps and is refused.\n\nEvery entry runs out: after its `ttl`, thirty days at most. An entry weighs what the cache keeps for it — its value and its key three times, a quarter more, and 320 bytes — and a project's entries together weigh at most its quota (`GET /cache/usage`). A write past the quota does not fail: the project's own entries nearest their end are dropped to make room. When every project's entries together fill the cache, the project that weighs the most gives back first; a project under its share keeps its entries. The cache is a cache: an entry may be gone before its time, and what must not be lost belongs in a database.\n\nA project reads and writes at most so many bytes a second (the second's first call is taken whatever its size), and makes at most its requests per second of calls; past either, a call is answered 429 with Retry-After. The cache's calls are not counted as the project's requests, and an answered one is not a line of the project's request log; the bytes its reads carry out are counted for the project (`cache.egress`).",
      "version": "1.0.0",
      "paths": 3,
      "url": "https://palbase.studio/openapi/cache.openapi.json"
    },
    {
      "module": "calls",
      "title": "Palbase Calls",
      "description": "Palbase's calls module: a project's people calling each other — one to one or in a group, by voice or with video — in one shared, multi-tenant service; every project is isolated by row security in its database.\n\nEvery call's media — one to one or in a group, voice or video — flows through the platform's media server (LiveKit, open source): a device gets a ticket into its call's room (`POST /calls/{call_id}/media`) and connects with LiveKit's open-source client libraries; where UDP is shut, over TCP on port 443. A direct call that a third person or the project's agent comes into goes on in the same room. The media never passes through this API: it keeps who called whom, when, how long and how it ended, and what the media server sent each participant — the history people read, and the data the project pays for (per GB the media server sent the call's people, voice and video alike).\n\nA person's devices ring by push (PushKit on iOS, a high-priority data message on Android, a notification in a browser) and hear their calls as they change on their own realtime channel, `calls:<ref>:<user_id>` (event `call`, carrying a call's snapshot).\n\nThe project's server, with its secret key, runs the module's settings, reads and ends calls, and lets its own agents into a call with a ticket. Palbase runs no agent of its own.",
      "version": "1.0.0",
      "paths": 21,
      "url": "https://palbase.studio/openapi/calls.openapi.json"
    },
    {
      "module": "campaigns",
      "title": "Palbase Campaigns API",
      "description": "Multi-channel Broadcasts (A/B + Holdout), unified On-Site & In-App Campaigns, and Allowlist-Protected Tracking Links.",
      "version": "1.0.0",
      "paths": 20,
      "url": "https://palbase.studio/openapi/campaigns.openapi.json"
    },
    {
      "module": "commerce",
      "title": "Palbase Commerce & Promotions",
      "description": "Palbase's unified commerce, multi-seller marketplace, and standalone promotions engine: shared catalog, multi-seller listings & deterministic Buy Box, digital assets & IAP entitlement bridge, optimistic-locked multi-location inventory, single-TX ACID checkout with blocking Standard Webhooks hooks, split seller OMS, RMA returns, invoices, settlements, and penny-accurate promotions.",
      "version": "1.0.0",
      "paths": 147,
      "url": "https://palbase.studio/openapi/commerce.openapi.json"
    },
    {
      "module": "flags",
      "title": "Palbase Flags",
      "description": "Palbase's flags module: a project's feature flags and remote configuration — typed values, the choices a string flag allows, conditions that target a value at a client context, a share of users, a country or a moment, and values given to single users — read by its apps, resolved for each reader, and kept up to date by deltas and realtime notices (flags:<ref> for every reader, flags:<ref>:<user_id> for one user). Definitions may change directly, or, once publishing is on, only through a reviewed and published template. Which builds of its apps are in use is counted from the reads. One shared, multi-tenant service: every replica caches the projects it serves, and a change on one drops them on every other.\n\nTwo doors. A client app reads with the publishable key, and a signed-in user's token makes the answer theirs. The project's server defines flags, sets users' values, publishes and reads installations with its secret key (`apikey`, role `service_role`).\n\nCountries are resolved with DB-IP's IP to City Lite database: IP geolocation by DB-IP (https://db-ip.com), CC BY 4.0.",
      "version": "1.0.0",
      "paths": 27,
      "url": "https://palbase.studio/openapi/flags.openapi.json"
    },
    {
      "module": "iap",
      "title": "Palbase IAP",
      "description": "Palbase's IAP module: what a project sells and what each of its customers has, in one shared, multi-tenant service; every project is isolated by row security in its database, and every key it keeps is sealed with the project's own data key.\n\nOne catalog, three channels. Each product is defined once — its kind, its plans and prices, its names in each language, what it gives (entitlements, credits, a quota) — and sold on the App Store, Google Play and the web through the project's own Stripe account, each channel configured with what is its own there: Apple's shorter names, a web price without the stores' commission. The stores are brought to the catalog by a plan a person sees and confirms; nothing is written store by store. Every purchase, from every channel, lands in one ledger, and a customer's apps read one answer, CustomerInfo — entitlements, subscriptions, IAP, credit balances and quota use — whatever store they bought in. Credits are spent in one step, or held for a job and committed after it; a quota counts use in a window and can overflow into credits. A guest's IAP go to the account it signs in to.\n\nThree doors. A customer's own app reads the offerings with any of the project's keys, and what the customer has, buys on the web, reports what StoreKit gave it in the App Store and merges a guest with the publishable key and the user's access token (a guest's too). The project's backend, Studio and the CLI reach everything else with the secret key (`apikey`, role `service_role`): the catalog, the Stripe account and the App Store connection, every customer, credits and quotas. Stripe's and the App Store's notifications (signed by the provider) and the pages a Stripe key or an In-App Purchase key is handed over on (a one-time grant) take no key. Changes emit `iap.*` events to the project's webhooks (`x-palbase-events`); the customer's apps hear of their own changes on the realtime channel `iap:<project ref>:<user id>` (theirs alone, read-only), whose state and `changed` broadcast carry `{\"revision\": N}`: a revision above the one read means reading GET /iap/me again.",
      "version": "1.0.0",
      "paths": 89,
      "url": "https://palbase.studio/openapi/iap.openapi.json"
    },
    {
      "module": "journeys",
      "title": "Palbase Journeys",
      "description": "Palbase's journeys module: a project's journeys — who enters (an event, an audience, a while without an event, an audience's members), the steps each person goes through (push, inbox, email, in-app, a coupon, an offer, properties written, an event to the project's backend, waits, branches, A/B splits), the goal that converts them and what takes them out — run for each person at their own time, exactly once each step. A journey is written whole (a definition), checked with every problem at its path, walked through by a made-up person before it is published, published, and then does not change: a copy is changed, published, and the old one stopped. Each person who enters a journey in a month counts toward the project's monthly journey people.\n\nOne door: the project's server, the CLI and Studio, with the secret key (`apikey`, role `service_role`).",
      "version": "1.0.0",
      "paths": 14,
      "url": "https://palbase.studio/openapi/journeys.openapi.json"
    },
    {
      "module": "machines",
      "title": "Palbase Machines",
      "description": "Palbase's machines module: a project's machines — isolated compute instances that run its backend. A machine runs an image of its project's own and answers at its own address under the app domain, where its requests are its customers' own (no API key is asked for there). A machine of a shared size is put to sleep when it is idle and woken by the next request, which waits for it; a dedicated one never sleeps. A change of image, size or port rolls out beside the version that serves. Emits `machine.created`, `machine.updated` and `machine.deleted`. A project's databases live here too: Postgres 18 of its own, reached from anywhere with TLS and a password at `<name>-<ref>.db.<domain>` — 5432 direct to Postgres, 6543 through the transaction pooler — with pgvector and PostGIS; a database of a free or hobby size is put to sleep when it is idle and woken by the next connection, the other sizes never sleep. Emits `database.created`, `database.updated`, `database.deleted`, `database.undeleted`, `database.purged` and `database.password_changed`; `database.restoring` as a restore is asked for, and `database.restore_failed` when one does not bring the database back to its moment (project_id, database, database_id, to, reason, then: `latest`, brought back to the latest moment of its backups instead; `kept`, it serves as it was; `failed`, it could not be brought back at all); and, once a month for a Free project — every environment's together, told to the environment of the database it was read from — of the hours its free and preview databases share, `database.awake_hours_warning` at 80% of them and `database.awake_hours_spent` as they are spent (project_id: that environment, studio_project: the Studio project whose hours they are, when it is of one, database: the free database it was read from, database_id, month, threshold, awake_hours: the project's free and preview databases' between them, every environment's, deleted ones too, awake_hours_limit, database_awake_hours: that database's own) — the same event, by its id, whenever it is delivered. A database on dedicated storage that does not grow automatically (or cannot now) emits `database.storage_warning` at 90% of its storage and `database.storage_full` as it is full and turns read-only — or as it is down, its disk filled before its storage (out_of_disk true; used_bytes is then its last reading; wal_stuck true when its data is well under its storage and write logs could not be archived) — (project_id, database, database_id, threshold, used_bytes, storage_bytes, storage_autoscaling, out_of_disk, wal_stuck) — once at each storage it holds.",
      "version": "1.0.0",
      "paths": 75,
      "url": "https://palbase.studio/openapi/machines.openapi.json"
    },
    {
      "module": "messaging",
      "title": "Palbase Messaging",
      "description": "Palbase's messaging module: a project's people talking — direct and group conversations, their members, their messages with replies, threads, reactions, edits and removals, files, timers, messages seen once, vanish mode and messages sent later — in one shared, multi-tenant service; every project is isolated by row security in its database.\n\nWhat a conversation says is kept sealed: each conversation has its own key (AES-256-GCM), itself sealed with the project's data key, whose own key is in the platform's key vault. A database dump, a backup or a disk holds no message. The platform holds the keys: this is not end-to-end encryption. Who wrote to whom, and when, is kept as it is: the order, the unread counts and the rights are read from it.\n\nA person's app follows what changed for them with `GET /messaging/sync` and hears it as it happens on their own realtime channel, `messaging:<ref>:<user_id>` (events `changes`, carrying the same shape as a sync, and `typing`). Pushes go through notify. Files are uploaded encrypted by the app, to the project's storage.\n\nThe project's server, with its secret key, runs the module's settings, reads and removes messages (every time in the access log), and reads the reports its people made.",
      "version": "1.0.0",
      "paths": 48,
      "url": "https://palbase.studio/openapi/messaging.openapi.json"
    },
    {
      "module": "notify",
      "title": "Palbase Notify",
      "description": "Palbase's notify module: a project's messages — email now — in one shared, multi-tenant service; every project is isolated by row security in its database.\n\nA project sends through the platform's shared sender within its limits, or through its own provider (Amazon SES, SendGrid, Azure Communication Services, SMTP), whose credentials are sealed with the project's own key. Templates are the platform's defaults, which a project may override. Only the project's secret key reaches this API (`apikey` header, role `service_role`). A message ends sent or failed, and emits `notification.sent` or `notification.failed` to the project's webhook.",
      "version": "1.0.0",
      "paths": 54,
      "url": "https://palbase.studio/openapi/notify.openapi.json"
    },
    {
      "module": "payments",
      "title": "Palbase Payments",
      "description": "Palbase's core payments & closed-loop wallet module: unified, multi-provider financial processing (Stripe, iyzico, Masterpass) with deterministic channel routing, server-sealed PaymentIntents, 1:N PaymentAttempts, 3DS/hosted/embedded NextAction orchestration, auth/capture, original or instant-wallet refunds, dispute/chargeback handling, recurring subscriptions, and an immutable double-entry closed-loop wallet ledger (top-up, single-use QR spend tokens, two-phase holds, split wallet+card checkout, atomic transfers, and zero-drift audit). Zero raw PAN/CVV ever touches Palbase (PCI-DSS SAQ-A).",
      "version": "1.0.0",
      "paths": 80,
      "url": "https://palbase.studio/openapi/payments.openapi.json"
    },
    {
      "module": "realtime",
      "title": "Palbase Realtime",
      "description": "Palbase's realtime module: channels a project's clients join over one socket — broadcasts between them, a shared keyed state with presence, and each user's own permission channel — in one shared, multi-tenant service of several replicas. A broadcast or a state change on one replica reaches every subscriber on every other; a channel's state outlives the replica that served it.\n\nTwo doors. The socket (/realtime/v1/websocket) is the client's: it belongs to the project its host names, and each join is decided by the user's token and the project's declaration. The project's server declares its channels, sets its limits and publishes as the server with its secret key (`apikey`, role `service_role`).\n\nEvery name on the platform's bus starts with the project's id, taken from the edge's signed identity: a project's clients reach its own channels only, however they spell one.",
      "version": "1.0.0",
      "paths": 7,
      "url": "https://palbase.studio/openapi/realtime.openapi.json"
    },
    {
      "module": "secrets",
      "title": "Palbase Secrets",
      "description": "Palbase's secrets module: a project's application secrets (a payment provider's key, a signing secret) per environment, in one shared, multi-tenant service; every project is isolated by row security in its database, and every value is sealed with the project's own data key, itself wrapped by the platform's key-encryption key.\n\nOnly the project's secret key reads and writes secrets (`apikey` header, role `service_role`); a publishable key ships in apps and is refused. Every write is a new version, every read and write is in the audit trail, and a change emits `secret.changed` — without the value — to the project's webhook.",
      "version": "1.0.0",
      "paths": 16,
      "url": "https://palbase.studio/openapi/secrets.openapi.json"
    },
    {
      "module": "storage",
      "title": "Palbase Storage",
      "description": "Palbase's storage module: a project's buckets and the files in them, in one shared, multi-tenant service. Each project's rows are isolated by row security, and its bytes by name: a blob is named by the row that claims it, under the project's id, so another project's are out of reach however a path is spelt.\n\nTwo doors. The project's — buckets, objects, signing — is the secret key's alone (`apikey`, role `service_role`): a publishable key ships in apps, and there is no client-side object surface. A client reads a public bucket at /storage/public/ with no credential, and reads or writes what a URL the project signed grants at /storage/signed/: the signature is the credential, and it pins one object, a time, and for an upload a ceiling, the content types and the owner.\n\nAn object's path is ONE percent-encoded URL segment (a/b.jpg is a%2Fb.jpg). Writes emit file.uploaded, file.deleted and file.moved to the project's webhook; what a project keeps, sends and asks is metered (storage.bytes, storage.egress, storage.operations).",
      "version": "1.0.0",
      "paths": 12,
      "url": "https://palbase.studio/openapi/storage.openapi.json"
    },
    {
      "module": "stores",
      "title": "Palbase Stores",
      "description": "Palbase's stores module: what a project does in Apple's and Google's stores on its own accounts — connecting the account, signing and handing builds to testers — in one shared, multi-tenant service; every project is isolated by row security in its database, and every key it keeps is sealed with the project's own data key.\n\nThe API is the project's secret key's (`apikey` header, role `service_role`). The pages a person or a build machine reaches with a one-time grant or token take no key: the grant or token is the authorization. Changes emit `stores.*` events to the project's webhooks (`x-palbase-events`).",
      "version": "1.0.0",
      "paths": 73,
      "url": "https://palbase.studio/openapi/stores.openapi.json"
    },
    {
      "module": "workspaces",
      "title": "Palbase Workspaces API",
      "description": "Independent content-agnostic synchronized workspaces (network disks) with ultra-low-latency multi-way sync, optional advisory locks, and S3-compatible access.",
      "version": "1.0.0",
      "paths": 17,
      "url": "https://palbase.studio/openapi/workspaces.openapi.json"
    }
  ]
}
