Skip to content

About OnlyJah

The OnlyJah API

Saying who is calling

Every call carries one of these. A missing or expired one gets 401: sign in again.

WithForHow
SessionSoil (/api/auth on the site)The cookie from signing in. On an OnlyJah site it is the site’s own, because the site passes /api/auth through to Soil.
Tokenapi.onlyjah.comGET /api/auth/token, then Authorization: Bearer <token>. Short-lived; the SDK’s token() keeps one fresh.
Site key/v1/public/*?key=<public key>. Safe in a web page: it only reads what the site made public.
Device key/v1/vaults, /v1/meFor a Kash device or runner. Reaches your vaults and nothing else.
Sign in with OnlyJahSites outside onlyjah.comOAuth 2.1 with PKCE against soil.onlyjah.com. The person approves; the site gets tokens it checks against Soil’s keys.
With a session: call Soil from the page
const r = await fetch('/api/auth/get-session', { credentials: 'include' })
const session = await r.json()   // { user, session } or null
With a token: call the OnlyJah API
const { token } = await (await fetch('/api/auth/token',
  { credentials: 'include' })).json()
const me = await fetch('https://api.onlyjah.com/v1/me', {
  headers: { authorization: `Bearer ${token}` },
}).then((r) => r.json())
No session on this device

Sign in first: a code by email (/email-otp/send-verification-otp, then /sign-in/email-otp), a passkey, or a password. With two-step on, a password sign-in asks for the authenticator code before any session exists (/two-factor/verify-totp). The session that follows is what every call above uses.

Soil

On every OnlyJah site at /api/auth (the site passes it through), and at soil.onlyjah.com/api/auth.

Sign-in and your account

Better Auth endpoints. Every OnlyJah site passes /api/auth through to Soil, so the session cookie is the site’s own.

CallWhoWhat it does
POST/api/auth/email-otp/send-verification-otp
anyoneEmail a six-digit code { email, type: "sign-in" }. Ten minutes, five tries.
POST/api/auth/sign-in/email-otp
anyoneSign in or join with that code { email, otp }. Confirms the address.
POST/api/auth/sign-up/email
anyoneJoin with a password { email, password, name }. At least 10 characters.
POST/api/auth/sign-in/email
anyoneSign in with a password. Asks for the second step when two-step is on.
POST/api/auth/passkey/*
signed in / anyoneAdd a passkey, or sign in with one. The device’s PIN or passcode is enough.
POST/api/auth/two-factor/*
signed inTurn on an authenticator app, verify a code, use a backup code.
GET/api/auth/get-session
signed inWho you are on this device, or null.
GET/api/auth/token
signed inA short-lived token for OnlyJah’s APIs (RS256 JWT): you, your badges and discounts, and the pod you act as.
POST/api/auth/update-user
signed inChange { name, bio, username, image }; publicProfile on test only.
POST/api/auth/sign-out
signed inSign out on this device.

Emails, pods and contexts

CallWhoWhat it does
POST/api/auth/addresses/add · /verify · /remove
signed inMore emails for one human. Login addresses sign you in; pod addresses reach the pod and sign nobody in.
POST/api/auth/organization/*
signed inPods: create one, invite by email, accept, set the one you act as.
GET/api/auth/contexts
signed in{ human, contexts, active }: you, the pods you act for and your role in each.
POST/api/auth/contexts/act
signed inAct as a pod { pod }, or as yourself { pod: null }. Your site decides how switching looks.

Market

On test only (soil test and api-test); not on soil.onlyjah.com yet. Listings, conversations and the deal ledger. No money passes through OnlyJah.

CallWhoWhat it does
GET/api/auth/market/listings?q=&terms=&category=
anyoneWhat is on the market now, newest first, with its categories.
GET/api/auth/market/listing?id=
anyoneOne listing and its seller.
GET/api/auth/market/mine
signed inYour listings, every status.
POST/api/auth/market/listings/save
signed inCreate or change yours { id?, title, terms, priceCents, wants, category, condition, place, description, images, links, showOnMarket }.
POST/api/auth/market/listings/status
the seller{ id, status }: active, pending, sold or removed.
POST/api/auth/market/threads/open
signed inMessage a seller about a listing { listingId }. One conversation per buyer and listing.
GET/api/auth/market/threads
signed inYour conversations, buying and selling, with unread marks.
GET/api/auth/market/thread?id=&after=
the two in itIts messages (only newer than after, when given) and deals.
POST/api/auth/market/messages/send
the two in it{ threadId, text }. Up to 2,000 characters, 20 a minute.
POST/api/auth/market/threads/read
the two in itMark it read.
POST/api/auth/market/deals/propose
the two in it{ threadId, terms: sale | barter | gift, amountCents?, exchange }. Proposing confirms your side.
POST/api/auth/market/deals/confirm
the other sideBoth confirmed: the deal is done and stays on both ledgers, unchanged.
POST/api/auth/market/deals/cancel
the two in itOnly before it is done.
GET/api/auth/market/ledger
signed inYour deals, and which wait on you.
GET/api/auth/market/summary
signed inCounts for dashboards: listings up, unread conversations, deals done and waiting.

Members

On test only; not on soil.onlyjah.com yet. Only members who turn on a public profile. Never an email, a pod or a badge.

CallWhoWhat it does
GET/api/auth/members?q=
anyonePublic profiles matching a name or username.
GET/api/auth/members/one?username=
anyoneOne public profile and its market listings.

Stream

CallWhoWhat it does
GET/api/auth/stream/profile?username=
anyoneA person’s public stream.
GET/api/auth/stream/collective?scope=
anyone / signed inEveryone’s, or who you follow.
GET/api/auth/stream/me
signed inYour sources and who you follow.
POST/api/auth/stream/sources/add · /remove
signed inLink a YouTube, Telegram, Instagram or WhatsApp source.
POST/api/auth/stream/items/hide · /stream/follow
signed inHide one of your posts; follow someone.

Sign in with OnlyJah (OAuth 2.1 / OpenID Connect)

For sites and apps outside OnlyJah, and OnlyJah’s own: the same rules for all. PKCE always; every site asks “Allow access?” the first time; each site sees its own id for a person.

CallWhoWhat it does
GETsoil.onlyjah.com/.well-known/openid-configuration
anyoneDiscovery: everything below, so a client configures itself.
GET/api/auth/oauth2/authorize
the personStart: sends them to Soil to sign in and approve.
POST/api/auth/oauth2/token
the siteTrade the code for tokens; refresh them.
GET/api/auth/oauth2/userinfo
the site, with a tokenWho the person is, by scope: openid, profile, email, offline_access, pods.
POST/api/auth/oauth2/introspect · /oauth2/revoke
the siteCheck or end a token.
GET/api/auth/jwks
anyoneSoil’s public keys. Check every token against them.

The OnlyJah API

api.onlyjah.com, and api-test.onlyjah.com for test. JSON in and out; any website may call it from a browser.

You and your sites

CallWhoWhat it does
GET/v1/me
signed inYour account, the sites you work on (with your role and what you can do) and the ones you’re a member of.
POST/v1/sites
signed inStart a site { name, slug?, domains? }.
GET · PATCH · DELETE/v1/sites/:site
its teamThe site: name, look, addresses, who may join.
GET · POST · PATCH · DELETE/v1/sites/:site/people
its teamWho is on the site and their role; add by email.
GET · POST · DELETE/v1/sites/:site/keys
developPublic and secret keys. A secret is shown once.
GET/v1/sites/:site/export
ownerEverything the site keeps, as one JSON document.

Shop, blog and files

CallWhoWhat it does
GET · POST · PATCH · DELETE/v1/sites/:site/products
shopItems. Each has Show on OJ Marketplace (onMarketplace). On test, also Use OJ Stripe Connect (useStripeConnect) and, when that’s off, buyUrl.
GET · POST · PATCH · DELETE/v1/sites/:site/makers
shop / moneyThe people whose work the site sells, their shares and statements.
GET · POST · PATCH · DELETE/v1/sites/:site/posts
contentBlog posts in Markdown.
POST/v1/sites/:site/share
contentPost from a pasted link (a video, a track): it plays in place.
GET · POST · PATCH · DELETE/v1/sites/:site/files
contentPhotos and digital inventory.
GET/v1/sites/:site/orders · /payments
shop / teamSales, and the site’s own Stripe account.

What websites read

With the site’s public key (?key=). A member’s website calls these straight from the browser.

CallWhoWhat it does
GET/v1/public/site
site keyThe site’s name, addresses and look.
GET/v1/public/products · /:sku
site keyThe shop. Filters: tag, category, q.
GET/v1/public/posts · /:slug
site keyThe blog.
GET/v1/public/events
site keyPublic events on the Spiral.
GET/v1/public/marketplace
anyoneEvery live site’s items listed on the OnlyJah marketplace.
POST · GET/v1/public/checkout
site keyBuy a cart through OJ Stripe Connect; check the result.
GET/embed/v1.js · /embed/style.css
anyoneThe embed: two lines a site pastes once to show its shop and blog.

Kash, Forge and Arks

CallWhoWhat it does
GET · POST · PATCH · DELETE/v1/vaults
you or your deviceKash vaults, kept in sync between your devices.
GET · POST · PUT/v1/vaults/:vault/changes · /blobs · /files
you or your deviceSync: what changed, upload bytes, commit changes.
POST/v1/vaults/:vault/publish · /unpublish
youA note with publish: <site> at its top becomes a post (Forge).
GET · POST/v1/vaults/:vault/jobs
you or your devicePipelines: queue work; a runner on your own machine claims it.
GET · POST · DELETE/v1/me/homes · /v1/me/devices
youYour own storage (any S3-compatible), and device keys.
GET · POST · PATCH · DELETE/v1/me/arks
youYour Arks and who may use each.
POST/v1/arks/enroll · /v1/arks/report
the ArkAn Ark joins with its one-time token, then reports in with its key.
GET · POST · PATCH · DELETE/v1/calendar · /v1/spiral
youYour events, and the Spiral counted by moons.

Where the data lives

Soil: Convex

Accounts, emails, pods, passkeys, sessions; the stream. On test, the market too: marketListing, marketThread, marketMessage, and marketDeal, the ledger. A finished deal is never changed or deleted.

The OnlyJah API: Postgres

Sites, keys, people and roles, products, orders, makers, posts, files, Kash vaults and their files, homes, jobs, Arks, events, usage.