Skip to content

Content

Sell access to what you publish, by subscription, by one-off purchase or by the read, to people and to their agents.

Issue: its lifecycle
drafted ──review──▶ reviewed ──publish──▶ published ──send──▶ sent
AccessPriceWhat it opens
Anyone0the list of Issues, each with its title and week
Issue.read0.25 a readone whole Issue, for a person or an agent
Member8 a monthevery Issue, and each edition by email
Guide.buy19 onceone Guide, kept for good

Content is records sold by access. Newsletters, digital products and communities are three shapes of it: an edition on a schedule, a file bought once, and a space members post in.

definition.ts
27 lines
import { define, generative } from 'apis.dev'

/** A weekly brief on the software companies that changed headcount, for members and their agents. */
export default define({
  name: 'briefs', domain: 'briefs.apis.dev',
  …
  sources: {
    firms: { api: 'companyfacts.apis.dev', cost: { 'Company.search': 0.005 } },
  },
  Issue: {                                              // an edition
    week: 'string!#', title: 'string', body: 'markdown',
    status: {
      draft:   { run: generative('This week in {firms}: who hired, who shrank') },
      review:  { in: 'drafted', role: 'editor' },      // a person reads every draft
      publish: { in: 'reviewed', role: 'editor' },
      send:    { in: 'published', to: 'Member' },       // a delivery send to every member
    },
  },
  Guide: { title: 'string', file: 'file' },             // a digital product
  on: { 'every Mon 06:00': 'Issue.draft', 'Issue.published': 'Issue.send' },
  offer: {
    'Issue.list': 0, 'Issue.read': 0.25,
    Member: { month: 8, includes: { 'Issue.read': 'all' } },
    'Guide.buy': { once: 19, grants: 'Guide.read' },
    terms: { license: { quote: 'with a link', train: false } },  // what a read allows
  },
})

briefs is built on companyfacts: its draft reads the week's changes as a Source, and deploy prints its margin. A person reviews every draft before it can publish.

Items, editions and access

FamilyWhat it does
Authored contentPosts, issues, pages and files, with drafts, versions, review and publishing, and full history
EditionsAn Issue on a schedule, drafted by a person or an agent, published by a Role, sent once
Access tiersPlans whose includes open whole items; anyone else sees what you leave open, and buys the rest
One-off productsA file or a bundle bought once, whose grant keeps it readable for good
Per-read salesAny item priced by the read, so an agent with a budget buys the one Issue it needs
CommunitiesA space with posts and comments by members, under moderation
Licence termsWhat a read allows, such as quoting with a link and no training, carried on every reply
ThingStatesWhat moves it
An Issuedrafted, reviewed, published, sentThe schedule drafts it, an editor reviews and publishes it, and publishing sends it
A member's accesstrialing, active, past_due, cancelledStripe's subscription; a cancelled member keeps access to the end of the paid period
A grantgranted, refundedA one-off purchase, or its refund under the published rule
A post in a spaceposted, held, removed, restoredA member posts; a flag or a rule holds it; a moderator removes or restores it, with a reason kept

Sending an edition

Publishing an Issue sends it to every member whose access is active, once, from your Domain. The send delivers what they bought, so it needs no separate consent. A member who turns email off still reads every Issue on the site and through the API.

Each send writes Issue.sent, and each member's delivery is kept with its state: sent, delivered, bounced or opened. A bounced address marks the member in the portal and stops further sends to it.

Selling a read to an agent

An agent researching a company needs one Issue, not a subscription. It reads the list for free, then the Issue it wants, at the posted price per read.

GET /issues/2026-W44, with no credits
HTTP/1.1 402 Payment Required
Content-Type: application/problem+json
X-Cost: price=0, currency="USD"
X-Request-Id: req_9b2d4e7a10c35f6e8d21

{
  "type": "https://briefs.apis.dev/docs/errors#payment_required",
  "title": "Payment Required",
  "status": 402,
  "detail": "The credit balance is 0; Issue.read draws 0.25 from it.",
  "code": "payment_required",
  "instance": "req_9b2d4e7a10c35f6e8d21",
  "offers": [
    { "kind": "verb", "name": "Issue.read", "price": 0.25,
      "checkout": "https://briefs.apis.dev/checkout/issue-read" },
    { "kind": "plan", "name": "Member", "price": 8,
      "checkout": "https://briefs.apis.dev/checkout/member" }
  ]
}

With credits, or paying inside the call under its mandate, the same request answers 200 with the whole Issue and X-Cost: price=0.25. The reply carries the licence terms, and the signed receipt names the Issue and its Version.

Contracts and the platform's part

You declareThe platform does
The content Nouns and their review and publish movesKeeps drafts, versions and history; refuses a publish that skips its review
A schedule and a sendDrafts on the schedule, sends to every active member once, and keeps each delivery's state
Plans, per-read prices and one-off purchasesOpens or closes each item on every Interface, sells the rest through Checkout and the 402, and grants for good what was bought once
terms in the OfferCarries them on every reply and receipt, and records each read against them
A space and its rulesHolds, removes and restores posts, and keeps the moderation record
SubsystemWhat Content takes from it
Definition and compileThe review move a publish needs, checked at deploy, and the margin over each Source's cost
Model and recordsAuthored content, files, versions, search and the space's posts
Identity, access and policyMembers, tiers, editor and moderator Roles, and the one decision on every read
Data and SourcesWhat the draft reads, and what you import from where you published before
RuntimeSchedules, the send, and Events for every publish, read and delivery
WorkReview of each draft, and moderation of each held post
CommerceSubscriptions, per-read prices, one-off grants and refunds, on Stripe
Interfaces and distributionDelivery sends, the site's public pages, directory entries and the offer card
Trust and operationsLicence terms on every read, and the moderation record

What members and their agents meet

A reader finds the list of Issues, reads one whole Issue for 0.25, or joins as a Member and gets each edition by email. A member manages the plan, the email preference and the receipts in the portal.

An agent finishes the same path with no UI:

  1. It lists Issues with listIssues, at no charge, and searches them by title.
  2. It reads one Issue with readIssue, paying 0.25 within its Max-Cost and mandate.
  3. It quotes from the Issue under the terms the reply carries, with the link.
  4. It keeps the signed receipt, which proves what it read and what that read allowed.