Appbricx
Docs
FeaturesPricingStart free

Get started

OverviewWhat Appbricx isQuickstart with a coding agentQuickstart with the builderCore concepts

Guides

Data and tablesAccess and rolesBusiness rulesSign-inCustom screensRealtime and topicsWorkflows, schedules and webhooksServer functionsAI in your appPaymentsFilesMessagesIntegrationsVerifyPublishing, domains and rollbackOperating your appExport and self-hostSelf-host install

Tutorials

Build a booking app with Claude CodeMulti-user todo listClient portalSlack on new sign-upTemplates

Reference

Reference homeFrontend SDKHTTP APIMCP toolsCLIIntegrations catalogContract formatAI key resolutionRun Appbricx locally

Topics and realtime

Publish messages on topics and subscribe to topics and row-changed feeds over server-sent events.

2 endpointsHTTP API referenceGuide: Live updates

On this page
  1. Authentication
  2. Endpoints
  3. POST /topics/:name/publish
  4. GET /topics/:name/subscribe

Base URL: your app's origin ($APP_ORIGIN): the published host, a custom domain, or the platform origin for the builder preview. Errors answer { ok: false, error: { code, message } } unless noted. Add x-appbricx-env: dev or prod to pick the database explicitly; otherwise the host decides (preview means dev, a published host means prod).

Authentication

App key + data marker
A project API key (dpk_c_… in browsers, bound to the app's origins; dpk_s_… on servers) or the builder preview token, plus the data-API marker header. With an app session (the header, or the appbricx_app_session cookie) the call acts as that user under row-level security; without one it acts as a guest. A server key may assert x-appbricx-app-user, x-appbricx-app-role and x-appbricx-app-org. Authorization: Bearer $APP_KEYx-appbricx-data-api: 1x-appbricx-app-session: $APP_SESSION (optional: acts as that user)

Endpoints

Publish on a topic

POST/__appbricx/topics/:name/publish

Publish a message to every subscriber of a topic. app:* and free-form names take any authenticated caller; row-changed:* takes server keys only.

Auth
App key + data marker: Authorization: Bearer $APP_KEYx-appbricx-data-api: 1x-appbricx-app-session: $APP_SESSION (optional: acts as that user)

Path parameters

NameTypeDescription
:namerequiredstringLetters, digits and _ : . - (e.g. app:kitchen).

Body

NameTypeDescription
payloadoptionalany JSONThe message.

Response

Response
{
  "ok": true
}

Errors

StatusCodeWhen
401UNAUTHORIZEDMissing or invalid Authorization bearer ("Missing Authorization: Bearer <token>", "Invalid API key").
400PARAMS_INVALIDThe x-appbricx-data-api: 1 header is missing.
403ORIGIN_NOT_ALLOWEDA browser key used from an origin it isn't bound to (ORIGIN_REQUIRED when there is no Origin at all).
429RATE_LIMITEDThe project's per-minute request budget is spent (600 for preview tokens and browser keys, 1200 for server keys by default).
400TOPIC_INVALIDBad name.
403TOPIC_PUBLISH_FORBIDDENrow-changed:* without a server key.
curl
curl -X POST "$APP_ORIGIN/__appbricx/topics/app:kitchen/publish" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "x-appbricx-data-api: 1" \
  -H "x-appbricx-app-session: $APP_SESSION" \
  -H "content-type: application/json" \
  -d '{"payload":{"order":"1042","status":"ready"}}'
fetch
const res = await fetch(`${APP_ORIGIN}/__appbricx/topics/app:kitchen/publish`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${APP_KEY}`,
    "x-appbricx-data-api": "1",
    "x-appbricx-app-session": APP_SESSION,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "payload": {
      "order": "1042",
      "status": "ready"
    }
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data.error?.message ?? data.error ?? res.statusText);

Relatedctx.topics.publish

Source: services/api/src/app-runtime/http/topics-routes.ts:81

Subscribe to a topic

GET/__appbricx/topics/:name/subscribe

A server-sent event stream: event: message with the JSON payload, and a ping every 15 seconds. Browsers' EventSource can't set headers, so this route also takes access_token and app_session as query parameters and doesn't need the data marker.

Auth
App key + data marker: Authorization: Bearer $APP_KEYx-appbricx-data-api: 1x-appbricx-app-session: $APP_SESSION (optional: acts as that user)

Path parameters

NameTypeDescription
:namerequiredstringapp:*, a free-form name, or row-changed:<table> (needs read access to the table).

Query parameters

NameTypeDescription
access_tokenoptionalstringThe app key, for EventSource.
app_sessionoptionalstringThe user's session, for EventSource.

Response

text/event-stream.

Response
event: message
data: {"event":"created","table":"tickets"}

event: ping
data:

Errors

StatusCodeWhen
401UNAUTHORIZEDMissing or invalid Authorization bearer ("Missing Authorization: Bearer <token>", "Invalid API key").
429RATE_LIMITEDThe project's per-minute request budget is spent (600 for preview tokens and browser keys, 1200 for server keys by default).
403TOPIC_FORBIDDENUnknown namespace, or no read access to the table.
curl
curl -N "$APP_ORIGIN/__appbricx/topics/row-changed:tickets/subscribe" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "x-appbricx-data-api: 1" \
  -H "x-appbricx-app-session: $APP_SESSION"
fetch
const res = await fetch(`${APP_ORIGIN}/__appbricx/topics/row-changed:tickets/subscribe`, {
  headers: {
    Authorization: `Bearer ${APP_KEY}`,
    "x-appbricx-data-api": "1",
    "x-appbricx-app-session": APP_SESSION,
  },
});
const reader = res.body!.getReader(); // text/event-stream

Relatedapp.live

Source: services/api/src/app-runtime/http/topics-routes.ts:97

On this page

  1. Authentication
  2. Endpoints
  3. POST /topics/:name/publish
  4. GET /topics/:name/subscribe
Appbricx

The backend, runtime and hosting for apps your coding agent builds. On our cloud, in yours, or on your own servers.

Features

Coding agents and MCPVerify testingBuilder consolePostgres databaseData APIRealtimeRow-level securitySign-in and authPaymentsWorkflows and jobsAI in your appIntegrationsBackups and rollbackHosting and domainsSelf-host and exportAll features

Product

ShowcasePricingFor coding agentsTemplatesPrivate cloudBring your own AI keyFAQ

Compare

Appbricx vs SupabaseLovable alternativeBolt alternativeFor freelancersFor agencies

Resources

DocumentationReferenceBlogSupportContact

© 2026 Appbricx. All rights reserved.

TermsPrivacyCookiesAcceptable Use