Developers › Docs

API documentation

Everything you need to build on Exnobase. The reference for each product ships as the platform rolls out — this page covers the concepts that apply everywhere.

Introduction

The Exnobase API is organized around REST. It has predictable, resource-oriented URLs under /api/v1, accepts and returns JSON, and uses standard HTTP verbs, status codes and authentication. Every product in Exnobase — payments, marketplace, social, mail, cloud, places and Twin AI — is reachable through the same consistent surface.

Early access. The platform is rolling out in phases. This page describes how the API works so you can design your integration now; live keys open per product on the changelog.

Base URL for every request:

https://exnobase.com/api/v1

Quickstart

Three steps take you from nothing to your first authenticated response. Everything below works in the sandbox with test keys, so there's no risk.

1. Create an app in the developer dashboard to receive a client ID and a key pair. 2. Copy your secret key (sk_test_…) for server-side use. 3. Call the API — fetch the authenticated account to confirm it works:

# cURL
curl https://exnobase.com/api/v1/me \
  -H "Authorization: Bearer sk_test_..."
// Node (fetch)
const res = await fetch("https://exnobase.com/api/v1/me", {
  headers: { Authorization: `Bearer ${process.env.EXNO_SECRET_KEY}` }
});
const me = await res.json();
console.log(me.handle);
# Python (requests)
import os, requests
r = requests.get(
    "https://exnobase.com/api/v1/me",
    headers={"Authorization": f"Bearer {os.environ['EXNO_SECRET_KEY']}"},
)
print(r.json()["handle"])

A successful call returns the account as JSON. From here, swap /me for any resource you have access to.

Authentication

There are two ways to authenticate, depending on what you're building:

  • API keys — for server-to-server calls on your own account. Preview applications receive test-mode keys: a publishable key (pk_test_…) may appear in the browser; the secret key (sk_test_…) must stay on your server and never be exposed.
  • OAuth 2.0 — when your app acts on behalf of another user. The user is redirected to Exnobase, approves the scopes you request, and you receive an access token. Use the Authorization Code flow with PKCE.
# Every request is authenticated with a bearer token
curl https://exnobase.com/api/v1/me \
  -H "Authorization: Bearer sk_test_..."

Scopes

OAuth apps request only the access they need. Users see exactly what they're granting and can revoke it any time from their settings. Requesting the minimum set builds trust and improves approval rates. Common scopes:

  • read:profile — read the user's public profile.
  • read:posts / write:posts — read, or publish posts on the user's behalf.
  • payments:charge — create charges and hosted checkouts with ExnoPay.
  • markt:read / markt:manage — read or manage ExnoMarkt products and orders.
  • twin:chat — call Twin AI and register tools.

OAuth flow step by step

Use this when your app acts on behalf of another Exnobase user. Register your redirect URI in the developer dashboard first (App → Settings), then:

1. Send the user to the consent screen. Generate a random code_verifier, derive code_challenge = base64url(sha256(verifier)), and redirect:

https://exnobase.com/oauth/authorize
  ?client_id=app_xxx
  &redirect_uri=https://yourapp.com/callback
  &response_type=code
  &scope=read:profile%20write:posts
  &state=RANDOM
  &code_challenge=CHALLENGE
  &code_challenge_method=S256

2. The user approves and we redirect back to redirect_uri?code=…&state=…. If they decline, you get ?error=access_denied. Always check that state matches what you sent.

3. Exchange the code for tokens from your server:

curl -X POST https://exnobase.com/oauth/token \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "authorization_code",
    "code": "oac_...",
    "client_id": "app_xxx",
    "code_verifier": "VERIFIER"
  }'

# → { "access_token": "exo_...", "refresh_token": "exr_...",
#     "token_type": "Bearer", "expires_in": 86400, "scope": "read:profile write:posts" }

4. Call the API with the access token exactly like an API key: Authorization: Bearer exo_…. Access tokens last 24 hours; refresh them with grant_type=refresh_token. Users can revoke your app any time from Settings → Connected apps, which invalidates its tokens immediately.

Writing on behalf of a user

With the write:posts scope you can publish for the authorized user. The post appears on their profile and timeline with its own clean URL:

curl -X POST https://exnobase.com/api/v1/posts \
  -H "Authorization: Bearer exo_..." \
  -H "Content-Type: application/json" \
  -d '{ "title": "Hello from my app", "text": "Posted through the Exnobase API." }'

# → 201 { "id": "p...", "url": "https://exnobase.com/sign/discussion/you/hello-from-my-app", ... }

Reading works the same way: GET /api/v1/posts returns the user's posts (needs read:posts). Text is moderated automatically, and every write is rate-limited per account.

Requests & responses

Send JSON with Content-Type: application/json. Successful responses return the resource as JSON. A few platform-wide conventions:

  • Timestamps are ISO 8601 strings in UTC (e.g. 2026-07-24T10:15:00Z).
  • Money is always an integer amount of ExnoCoin — never a float — so there are no rounding errors.
  • IDs are opaque strings; don't parse them, just store them.
  • Booleans and nulls are explicit; missing fields are omitted rather than sent as empty strings.

Pagination

List endpoints return a page of results plus a cursor. Pass the cursor back as ?after= to fetch the next page, and keep going until has_more is false. Cursor pagination stays correct even as new items are created.

# first page, then follow the cursor
curl "https://exnobase.com/api/v1/posts?limit=20" -H "Authorization: Bearer sk_test_..."
curl "https://exnobase.com/api/v1/posts?limit=20&after=CURSOR" -H "Authorization: Bearer sk_test_..."

Idempotency

For any request that creates something — a charge, an order, a post — send an Idempotency-Key header with a unique value. If the request is retried (a dropped connection, a timeout), Exnobase returns the original result instead of creating a duplicate. This makes payments and orders safe to retry.

curl https://exnobase.com/api/v1/pay/charges \
  -H "Authorization: Bearer sk_test_..." \
  -H "Idempotency-Key: order_8842_attempt_1" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 250, "currency": "EXNO" }'

Errors

Exnobase uses conventional HTTP status codes: 2xx for success, 4xx for problems with your request (a missing parameter, an unauthorized call), and 5xx for errors on our side. Every error returns a machine-readable error code and a human-readable message.

{
  "error": "unauthorized",
  "message": "Missing or invalid API key."
}

Codes you'll see most often:

  • 400 bad_request — a parameter is missing or invalid.
  • 401 unauthorized — missing, invalid or expired credentials.
  • 403 forbidden — authenticated, but the key or token lacks the required scope.
  • 404 not_found — the resource doesn't exist or isn't visible to you.
  • 409 conflict — a duplicate or conflicting state (often caught by an idempotency key).
  • 429 rate_limited — too many requests; read Retry-After and back off.
  • 5xx server_error — a problem on our side; safe to retry with the same idempotency key.

Rate limits

Requests are rate-limited per key and per tier. Each response includes your current budget so you can pace yourself:

  • X-RateLimit-Limit — requests allowed in the window.
  • X-RateLimit-Remaining — requests left.
  • Retry-After — seconds to wait after a 429.

Preview limits are sized for building and testing. Production limits will be set when production access opens. When you hit a limit, back off exponentially and retry — don't hammer the endpoint.

Webhooks

Instead of polling, subscribe to events and Exnobase POSTs them to your endpoint as they happen. Example events:

  • payment.succeeded / payment.failed / refund.done
  • order.created / order.paid / order.shipped
  • post.created / comment.new / follower.new / mention

Every delivery carries an X-Exno-Signature header — an HMAC-SHA256 of the raw body using your webhook secret. Verify it before trusting the payload, and always compare using a constant-time check. Failed deliveries are retried with exponential backoff.

// Node — verify a webhook signature
import crypto from "crypto";
function verify(rawBody, signature, secret) {
  const expected = crypto.createHmac("sha256", secret)
    .update(rawBody).digest("hex");
  return crypto.timingSafeEqual(
    Buffer.from(signature), Buffer.from(expected));
}

Versioning

The API is versioned in the path (/api/v1). We add new fields and endpoints without bumping the version — your integration keeps working. A breaking change only ever ships under a new version (/api/v2), and the old one is supported during a clear deprecation window announced on the changelog. Treat unknown fields as optional and you'll rarely need to change anything.

Test access and production

Developer Preview. Applications created in the developer dashboard receive test-mode credentials only (pk_test_… / sk_test_…). Production credentials are not issued, and there is no separate mirrored environment: preview credentials act on your own account’s data, so treat them as live credentials and keep the secret key on your server.

Public production access, public webhook registration and self-service credentials are not yet generally available. When production access opens, it will require an approved application, valid credentials and additional review for sensitive scopes such as payments — which also depend on business verification and licensed payment partners. Follow platform status and the changelog.