Skip to content

Form backend for agencies: many client sites, one inbox per client, one contract per partner

The operator's path. Fifteen sites, fifteen slightly different forms, one partner who wants one shape between two dates. Configured without code.

Projects for people, streams for routing

A project is a folder (a client, a niche). Projects never route. A stream is the routing object: it selects forms by id or by tag (tag:vending, project:prj_…), owns a versioned output schema, and carries a mapping per form. Routes hang off the stream.

create the stream
curl -X POST https://postbag.dev/v1/streams -H "Authorization: Bearer pb_live_…" -d '{
  "name": "Vending leads", "slug": "vending-leads",
  "schema": { "json_schema": { "type": "object", "required": ["name","phone"],
    "properties": { "name": {"type":"string"}, "company": {"type":"string"}, "phone": {"type":"string"}, "message": {"type":"string"}, "site": {"type":"string"} } } },
  "sources": [ { "selector": "tag:vending", "mapping": { "name": {"from":"fullName"}, "phone": {"from":"tel"}, "site": {"const":"fleet"} } } ]
}'

One partner, one window, one digest

A route from the stream to the partner's signed webhook with window { from, until } delivers only inside the campaign. A second route to the ops inbox in digest mode sends one email at 08:00 Europe/Stockholm with the day's leads. Both are rules on the route, not code in fifteen sites.

The sixteenth site

POST /v1/forms with from_template: st_… creates a form pre-attached to the stream with a valid mapping and a managed schema served at /s/{id}/schema. A site factory, or the agent building the site, cannot produce a form the stream does not understand. This is how Postbag's own site fleet is provisioned.

Change without surprise

When a site adds a field, drift shows up on the form. When the partner wants a new field, publish stream schema v2; every mapping is re-validated and stream.schema.changed goes out to anyone subscribed. Deliveries carry the schema version they conform to.

Questions, answered

Can each client see only their own forms?
Organizations are the tenant boundary; team roles and invitations are on the commercial roadmap. Today an agency typically runs one organization with projects per client.
Can I deliver to a partner only during a campaign?
Yes: set window.from and window.until on the route. Outside the window, deliveries are created as skipped with reason window, so you can see them.

Your first form is three minutes away.

Sign up, get a submit URL, point a form at it. The first submission lands in your inbox and your email. Everything else appears when you need it.