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.
| With | For | How |
|---|---|---|
| Session | Soil (/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. |
| Token | api.onlyjah.com | GET /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/me | For a Kash device or runner. Reaches your vaults and nothing else. |
| Sign in with OnlyJah | Sites outside onlyjah.com | OAuth 2.1 with PKCE against soil.onlyjah.com. The person approves; the site gets tokens it checks against Soil’s keys. |
const r = await fetch('/api/auth/get-session', { credentials: 'include' })
const session = await r.json() // { user, session } or nullconst { 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())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.
| Call | Who | What it does |
|---|---|---|
POST /api/auth/email-otp/send-verification-otp | anyone | Email a six-digit code { email, type: "sign-in" }. Ten minutes, five tries. |
POST /api/auth/sign-in/email-otp | anyone | Sign in or join with that code { email, otp }. Confirms the address. |
POST /api/auth/sign-up/email | anyone | Join with a password { email, password, name }. At least 10 characters. |
POST /api/auth/sign-in/email | anyone | Sign in with a password. Asks for the second step when two-step is on. |
POST /api/auth/passkey/* | signed in / anyone | Add a passkey, or sign in with one. The device’s PIN or passcode is enough. |
POST /api/auth/two-factor/* | signed in | Turn on an authenticator app, verify a code, use a backup code. |
GET /api/auth/get-session | signed in | Who you are on this device, or null. |
GET /api/auth/token | signed in | A 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 in | Change { name, bio, username, image }; publicProfile on test only. |
POST /api/auth/sign-out | signed in | Sign out on this device. |
Emails, pods and contexts
| Call | Who | What it does |
|---|---|---|
POST /api/auth/addresses/add · /verify · /remove | signed in | More emails for one human. Login addresses sign you in; pod addresses reach the pod and sign nobody in. |
POST /api/auth/organization/* | signed in | Pods: 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 in | Act 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.
| Call | Who | What it does |
|---|---|---|
GET /api/auth/market/listings?q=&terms=&category= | anyone | What is on the market now, newest first, with its categories. |
GET /api/auth/market/listing?id= | anyone | One listing and its seller. |
GET /api/auth/market/mine | signed in | Your listings, every status. |
POST /api/auth/market/listings/save | signed in | Create 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 in | Message a seller about a listing { listingId }. One conversation per buyer and listing. |
GET /api/auth/market/threads | signed in | Your conversations, buying and selling, with unread marks. |
GET /api/auth/market/thread?id=&after= | the two in it | Its 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 it | Mark 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 side | Both confirmed: the deal is done and stays on both ledgers, unchanged. |
POST /api/auth/market/deals/cancel | the two in it | Only before it is done. |
GET /api/auth/market/ledger | signed in | Your deals, and which wait on you. |
GET /api/auth/market/summary | signed in | Counts 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.
| Call | Who | What it does |
|---|---|---|
GET /api/auth/members?q= | anyone | Public profiles matching a name or username. |
GET /api/auth/members/one?username= | anyone | One public profile and its market listings. |
Stream
| Call | Who | What it does |
|---|---|---|
GET /api/auth/stream/profile?username= | anyone | A person’s public stream. |
GET /api/auth/stream/collective?scope= | anyone / signed in | Everyone’s, or who you follow. |
GET /api/auth/stream/me | signed in | Your sources and who you follow. |
POST /api/auth/stream/sources/add · /remove | signed in | Link a YouTube, Telegram, Instagram or WhatsApp source. |
POST /api/auth/stream/items/hide · /stream/follow | signed in | Hide 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.
| Call | Who | What it does |
|---|---|---|
GET soil.onlyjah.com/.well-known/openid-configuration | anyone | Discovery: everything below, so a client configures itself. |
GET /api/auth/oauth2/authorize | the person | Start: sends them to Soil to sign in and approve. |
POST /api/auth/oauth2/token | the site | Trade the code for tokens; refresh them. |
GET /api/auth/oauth2/userinfo | the site, with a token | Who the person is, by scope: openid, profile, email, offline_access, pods. |
POST /api/auth/oauth2/introspect · /oauth2/revoke | the site | Check or end a token. |
GET /api/auth/jwks | anyone | Soil’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
| Call | Who | What it does |
|---|---|---|
GET /v1/me | signed in | Your 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 in | Start a site { name, slug?, domains? }. |
GET · PATCH · DELETE /v1/sites/:site | its team | The site: name, look, addresses, who may join. |
GET · POST · PATCH · DELETE /v1/sites/:site/people | its team | Who is on the site and their role; add by email. |
GET · POST · DELETE /v1/sites/:site/keys | develop | Public and secret keys. A secret is shown once. |
GET /v1/sites/:site/export | owner | Everything the site keeps, as one JSON document. |
Shop, blog and files
| Call | Who | What it does |
|---|---|---|
GET · POST · PATCH · DELETE /v1/sites/:site/products | shop | Items. 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 / money | The people whose work the site sells, their shares and statements. |
GET · POST · PATCH · DELETE /v1/sites/:site/posts | content | Blog posts in Markdown. |
POST /v1/sites/:site/share | content | Post from a pasted link (a video, a track): it plays in place. |
GET · POST · PATCH · DELETE /v1/sites/:site/files | content | Photos and digital inventory. |
GET /v1/sites/:site/orders · /payments | shop / team | Sales, 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.
| Call | Who | What it does |
|---|---|---|
GET /v1/public/site | site key | The site’s name, addresses and look. |
GET /v1/public/products · /:sku | site key | The shop. Filters: tag, category, q. |
GET /v1/public/posts · /:slug | site key | The blog. |
GET /v1/public/events | site key | Public events on the Spiral. |
GET /v1/public/marketplace | anyone | Every live site’s items listed on the OnlyJah marketplace. |
POST · GET /v1/public/checkout | site key | Buy a cart through OJ Stripe Connect; check the result. |
GET /embed/v1.js · /embed/style.css | anyone | The embed: two lines a site pastes once to show its shop and blog. |
Kash, Forge and Arks
| Call | Who | What it does |
|---|---|---|
GET · POST · PATCH · DELETE /v1/vaults | you or your device | Kash vaults, kept in sync between your devices. |
GET · POST · PUT /v1/vaults/:vault/changes · /blobs · /files | you or your device | Sync: what changed, upload bytes, commit changes. |
POST /v1/vaults/:vault/publish · /unpublish | you | A note with publish: <site> at its top becomes a post (Forge). |
GET · POST /v1/vaults/:vault/jobs | you or your device | Pipelines: queue work; a runner on your own machine claims it. |
GET · POST · DELETE /v1/me/homes · /v1/me/devices | you | Your own storage (any S3-compatible), and device keys. |
GET · POST · PATCH · DELETE /v1/me/arks | you | Your Arks and who may use each. |
POST /v1/arks/enroll · /v1/arks/report | the Ark | An Ark joins with its one-time token, then reports in with its key. |
GET · POST · PATCH · DELETE /v1/calendar · /v1/spiral | you | Your events, and the Spiral counted by moons. |
Where the data lives
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.
Sites, keys, people and roles, products, orders, makers, posts, files, Kash vaults and their files, homes, jobs, Arks, events, usage.