HatchedDocs
Reference

HTTP API

Lean API contract and state machines — V1 scope, endpoints, authentication, and the business processes behind each operation.

Most integrations should use @hatched/sdk-js rather than calling these endpoints directly — it handles auth, retries, idempotency, error parsing, and edge runtimes for you. Reach for raw HTTP only when there's no SDK for your language.

Quick reference

Base URL (production)https://api.hatched.live/api/v1
Base URL (staging)https://api.staging.hatched.live/api/v1
AuthAuthorization: Bearer <key> — secret key (hatch_live_* / hatch_test_*, server-only) or publishable key (hatch_pk_*, limited reads). Widgets pass a short-lived session token instead. See Auth model.
CasingThe raw HTTP API uses snake_case for every request and response field (user_id, buddy_id, ttl_seconds). Sending camelCase is rejected (property userId should not exist). @hatched/sdk-js is the only place you write camelCase — it converts to snake_case on the wire and back on responses. SDK code samples (```ts) use camelCase; raw HTTP samples (```http / curl) use snake_case. (The error envelope below is the one camelCase exception — requestId, not request_id.)
First-run flowMinting a widget token requires an existing buddy_id — you can't go from user_id straight to a session token. The full path (published config → reuse-or-create egg → ready → hatch → poll operation → persist buddy_idPOST /widget-sessions) is in First user bootstrap.
ErrorsAlways the canonical envelope { "error": { "code", "message", "details?", "requestId" } }. Codes are stable — branch on code, not message. See Error codes.
Request correlationEvery request echoes an X-Request-Id header; it also appears in the error envelope, your logs, and outgoing webhook payloads. Include it in support requests.
IdempotencyPOST /events dedupes on the event_id you supply — resending is a no-op. Other writes are not automatically idempotent; don't blind-retry them, and guard POST /eggs against React Strict Mode / focus re-runs (see the bootstrap guide).
Async workImage-producing calls (hatch, evolve, equip) return an operationId. Poll GET /operations/{id} or use operations.wait(id) in the SDK. Don't tight-loop.
PaginationList endpoints return either { data, nextCursor } (cursor-based — pass cursor) or { data, meta: { page, limit, total } } (page-based — pass page). The field present on the response tells you which.
Rate limitsPer-key quotas; 429 responses carry Retry-After and X-RateLimit-* headers. The SDK retries with backoff by default. See Rate limits.
Billing402 with code: 'credit_insufficient', event_quota_exceeded, or plan_feature_locked when you hit a billing limit. See Handling 402.

The rest of this page is the V1 product contract — scope, state machines, and the business processes behind each operation. The full machine-generated endpoint list is in Endpoints below.


Goal: Position Hatched as a narrow-scope product that does one thing exceptionally well, rather than an "enterprise does-everything" platform.

This document clarifies three things:

  1. Which business processes V1 definitively supports
  2. Which state machines make the system deterministic
  3. How the API contracts stay lean and easy to integrate

1. Product Philosophy

V1 targets for Hatched:

  • Not a "platform" where the customer designs their own game
  • A service that reliably produces buddy progression from the customer's existing product events

That's why V1 follows these principles:

  • Template-first: limited rule types instead of a free-form rule language
  • Publish-before-live: progression config changes are edited in draft, then published
  • Async-by-default: visual-producing jobs are tracked via operations
  • Read vs write separation: easy for widgets to read, tighter controls on mutations
  • Canonical state lives in Hatched: customers may keep a local copy, but Hatched is the source of truth

2. V1 Scope

2.1 Definitely in V1

  • Preset plan selection and customization
  • Skill set definition
  • Coin rules
  • Badge rules
  • Evolution readiness and evolution trigger
  • Item marketplace
  • Buddy widget
  • Marketplace widget
  • Event ingestion
  • Webhook delivery
  • Multi-buddy support

2.2 Not in V1

  • Full no-code workflow builder
  • Unlimited rule engine with if/else trees
  • Cross-customer shared economy
  • Buddy-to-buddy social graph
  • Full user-level CRM
  • Real-time multiplayer / competition engine
  • Arbitrary CSS/JS execution on the customer side
  • Custom approval flows tailored per customer need

2.3 Deliberately limited in V1

  • Rule types are picked from fixed enums
  • Widget theme is configurable but not an infinite design surface
  • Evolution capped at 5 stages
  • Token types start with a limited set of system tokens
  • Marketplace visibility and requirement logic ships with predefined operators

3. User-Friendly Business Processes

3.1 Customer onboarding

Goal: ship an integration that's live in 10 minutes.

Flow:

  1. Customer creates an account
  2. Picks a preset plan
  3. Lightly edits skill, badge, coin and evolution fields
  4. Publishes the draft
  5. Receives an API key
  6. Sends the first POST /events request
  7. Generates a widget token and embeds it

UI principles:

  • First screen exposes at most 3 major decisions: preset, style, widget theme
  • "Advanced" fields are collapsed by default in every editor
  • No "empty page" feeling; the starter config from the preset is always visible

3.2 Progression config change

Goal: make changes without disturbing existing users' balance.

Flow:

  1. Customer opens the draft config
  2. Edits skill/badge/coin/evolution fields
  3. System shows an impact summary:
    • affects new buddies
    • does not affect existing buddies
    • migration can be run separately on demand
  4. Customer publishes
  5. New config_version becomes active

UI principles:

  • "Save" and "Publish" separation must be obvious
  • Publish modal uses impact language, not technical jargon
  • "This change does not retroactively affect existing buddies" must be clearly shown

3.3 Event-driven reward generation

Goal: the customer only sends the event; Hatched computes the reward.

Flow:

  1. Customer sends the event via POST /events
  2. Hatched deduplicates the event
  3. Rule engine computes effects
  4. Writes coin/token/badge/streak/evolution_ready effects
  5. Emits a webhook if needed

UI principles:

  • Dashboard shows "recent events" and "generated effects" side by side
  • Debug screen gives a clear answer to "why didn't this event produce a reward?"

3.4 Hatch / equip / evolve

Goal: make visual-producing flows deterministic and understandable.

Flow:

  1. Customer or widget initiates an action
  2. API returns an operation_id
  3. Worker finishes the job
  4. Result arrives via webhook or polling

UI principles:

  • "Processing..." is a first-class state
  • Error messages are action-specific, not generic "Image generation failed"
  • The user must not retry the same action in a panic

3.5 Widget access

Goal: easy to integrate, but controlled on the write side.

Modes:

  • Read-only embed: buddy widget, leaderboard
  • Interactive session: marketplace purchase, equip item

UI principles:

  • Embed snippet must be short
  • Token generation should feel like a "copy-paste snippet" experience
  • A read-only embed should require the minimum possible backend integration

4. Canonical Domain Concepts

4.1 Customer

The B2B tenant that uses Hatched.

Owns:

  • plan
  • settings
  • active_config_version_id

4.2 ConfigVersion

Immutable snapshot of progression logic.

Contains:

  • skill set
  • coin rules
  • badge definitions
  • evolution rules
  • token rules
  • marketplace requirements

4.3 Egg

The pending object before a buddy is born.

Rules:

  • bound to a specific user
  • created with a config_version
  • transitions to a closed state once hatched

4.4 Buddy

A user-owned progression unit.

Rules:

  • a user can own multiple buddies
  • a buddy is pinned to a single config_version
  • its version does not change unless migration happens

4.5 EventIngestion

The recorded external domain event from a customer.

Rules:

  • customer_id + event_id is unique
  • the same event does not produce a reward twice

4.6 EconomyLedger

Immutable ledger of coin/token mutations.

Rules:

  • each row is a credit or a debit
  • balance is a computed/projection field
  • mutation endpoints write to the ledger

4.7 Operation

Record for tracking an asynchronous job.

Types:

  • hatch
  • equip_item
  • evolve

5. State Machines

5.1 ConfigVersion State Machine

States:

  • draft
  • published
  • archived

Transitions:

  • draft -> published
  • published -> archived

Rules:

  • only one published version may be active
  • publish creates a new version; it never mutates an existing one

5.2 Egg State Machine

States:

  • waiting
  • ready
  • hatching
  • hatched
  • cancelled

Transitions:

  • waiting -> ready
  • ready -> hatching
  • hatching -> hatched
  • waiting -> cancelled
  • ready -> cancelled

Rules:

  • hatch may only be initiated from ready
  • hatching persists until the operation completes

5.3 Buddy State Machine

The top-level buddy state is kept simple:

  • active
  • archived

A buddy's real variables are:

  • evolution_stage
  • skills
  • coins
  • tokens
  • equipped_items

Rules:

  • an attribute-based model is preferred over a progression state machine
  • this keeps the UI simpler

5.4 Operation State Machine

States:

  • pending
  • processing
  • completed
  • failed
  • cancelled

Transitions:

  • pending -> processing
  • processing -> completed
  • processing -> failed
  • pending -> cancelled

Rules:

  • the client never treats the result as final until it sees completed/failed

5.5 WidgetSession State Machine

States:

  • issued
  • active
  • expired
  • revoked

Rules:

  • read-only tokens may be longer-lived
  • interactive tokens must be short-lived
  • interactive tokens operate on scopes

6. Lean API Contract

6.1 Public integration endpoints

POST /api/v1/eggs

Purpose:

  • create a pending egg record for a user

Query params:

  • ensure=true — return this user's most recent waiting/ready egg if one already exists instead of creating a new one (idempotent first-run bootstrap; also dodges the per-user active-egg cap on retries).

Request:

{
  "user_id": "user_123",
  "metadata": {
    "age": 12,
    "level": "beginner"
  }
}

Response:

{
  "egg_id": "egg_abc",
  "status": "waiting",
  "visual_variant": 7,
  "config_version_id": "cfg_v12",
  "user_id": "user_123",
  "buddy_id": null,
  "metadata": { "age": 12, "level": "beginner" },
  "created_at": "2026-04-08T10:30:00Z"
}

buddy_id is null until the egg reaches status: "hatched", after which it carries the hatched buddy's id (same on GET /api/v1/eggs/{egg_id} and GET /api/v1/eggs).

Errors:

  • 409 no_published_config — the customer has no published config version yet; details.publish_url links to the dashboard publish page.
  • 409 active_egg_limit — the per-user active-egg cap is reached; details.active lists the existing eggs (egg_id, status, created_at) and details.max the cap. Hatch/cancel one, or retry with ?ensure=true.

PATCH /api/v1/eggs/{egg_id}/status

Purpose:

  • mark the egg ready or cancel it

Allowed statuses:

  • ready
  • cancelled

POST /api/v1/eggs/{egg_id}/hatch

Purpose:

  • kick off an async hatch operation

Response:

{
  "accepted": true,
  "operation_id": "op_123",
  "status": "pending"
}

POST /api/v1/events

Purpose:

  • ingest a customer domain event

Request:

{
  "event_id": "evt_789",
  "user_id": "user_123",
  "type": "lesson_completed",
  "occurred_at": "2026-04-08T10:30:00Z",
  "properties": {
    "lesson_id": "lesson_456",
    "score": 87
  }
}

Response:

{
  "accepted": true,
  "event_id": "evt_789",
  "effects": {
    "coins": 10,
    "badges_awarded": [],
    "tokens": [],
    "evolution_ready": false
  }
}

GET /api/v1/buddies/{buddy_id}

Purpose:

  • return canonical buddy state

POST /api/v1/buddies/{buddy_id}/evolve

Purpose:

  • start an async evolution operation

PATCH /api/v1/buddies/{buddy_id}/equipped-items

Purpose:

  • start an equip/unequip operation

GET /api/v1/operations/{operation_id}

Purpose:

  • read the status of a hatch/equip/evolve

6.2 Manual override endpoints

These endpoints ship in V1 but are not marketed as the "primary flow":

  • PATCH /buddies/{id}/skills
  • POST /buddies/{id}/coins
  • POST /buddies/{id}/coins/spend
  • POST /buddies/{id}/badges
  • POST /buddies/{id}/tokens

Use cases:

  • admin correction
  • migration
  • special campaign
  • support operation

6.3 Widget endpoints

POST /api/v1/widget-sessions

Purpose:

  • mint an interactive widget session token

Request:

{
  "buddy_id": "bdy_abc123",
  "scopes": ["marketplace:purchase", "items:equip"]
}

Response:

{
  "token": "wgt_sess_xxx",
  "expires_at": "2026-04-08T11:00:00Z"
}

POST /api/v1/embed-tokens

Purpose:

  • mint a signed token for a read-only widget

7. UX Guardrails for the Dashboard

7.1 Rule templates instead of a rule builder

The V1 panel must offer:

  • Pick a trigger
  • Pick a reward
  • Pick a limit
  • Preview impact

The V1 panel must NOT offer:

  • nested if/else
  • custom expression language
  • event transformation DSL
  • arbitrary JSON editor as the primary UX

7.2 Publish UX

Every progression editor follows this shape:

  • Draft badge
  • Unsaved changes indicator
  • Publish CTA
  • Impact summary
  • "Publish a new version" instead of a rollback model

7.3 Support UX

Support/operator screens must surface:

  • recent events
  • effects generated from an event
  • operation status
  • the user's buddy list
  • recent ledger activity

These screens exist for operational confidence, not enterprise complexity.


8. Business Process Decisions

8.1 What we keep centralized

Hatched owns the truth for:

  • progression truth
  • config version truth
  • buddy ownership truth
  • operation truth
  • ledger truth

8.2 What we leave to the customer

The customer owns:

  • event production
  • user identity mapping
  • when a product action emits an event
  • maintaining the buddy ID list inside their own product UI
  • which widget appears on which screen

8.3 What we deliberately don't build

  • We do not move the customer's whole business logic into Hatched
  • We are not a full BPM/workflow product
  • We are not a CRM or engagement automation hub
  • We do not build an infinitely configurable admin panel

"Customer events in, progression out."

That's the strongest, simplest positioning for the product:

  • The customer emits events
  • Hatched computes progression
  • The widget renders the result

Everything else is secondary.

Endpoints

MethodPathSummarySource
GET/api/v1/admin/auditSearch admin audit logapps/api/src/admin/admin-audit.controller.ts
POST/api/v1/admin/auth/loginAdmin loginapps/api/src/admin/admin-auth.controller.ts
POST/api/v1/admin/auth/logoutStateless logout (client should drop token)apps/api/src/admin/admin-auth.controller.ts
GET/api/v1/admin/auth/meCurrent admin profileapps/api/src/admin/admin-auth.controller.ts
GET/api/v1/admin/customersList customers (search/filter/paginate)apps/api/src/admin/admin-customers.controller.ts
DELETE/api/v1/admin/customers/:idSoft-delete a customer (sets deleted_at)apps/api/src/admin/admin-customers.controller.ts
GET/api/v1/admin/customers/:idCustomer detail (counts, balances)apps/api/src/admin/admin-customers.controller.ts
PATCH/api/v1/admin/customers/:idUpdate customer profile (name/email/settings)apps/api/src/admin/admin-customers.controller.ts
GET/api/v1/admin/customers/:id/api-keysList customer API keysapps/api/src/admin/admin-customers.controller.ts
POST/api/v1/admin/customers/:id/api-keys/:keyId/revokeRevoke a customer API keyapps/api/src/admin/admin-customers.controller.ts
POST/api/v1/admin/customers/:id/api-keys/publishableIssue a publishable key for the customerapps/api/src/admin/admin-customers.controller.ts
GET/api/v1/admin/customers/:id/billingBilling snapshot (DB + reconciled view)apps/api/src/admin/admin-billing.controller.ts
POST/api/v1/admin/customers/:id/billing/cancel-subscriptionCancel the customer Stripe subscriptionapps/api/src/admin/admin-billing.controller.ts
POST/api/v1/admin/customers/:id/billing/refundRefund the most recent charge and (optionally) claw back creditsapps/api/src/admin/admin-billing.controller.ts
POST/api/v1/admin/customers/:id/billing/syncReconcile DB columns from Stripeapps/api/src/admin/admin-billing.controller.ts
GET/api/v1/admin/customers/:id/creditsCredit balance + recent transactionsapps/api/src/admin/admin-credits.controller.ts
POST/api/v1/admin/customers/:id/credits/adjustApply a signed manual credit adjustmentapps/api/src/admin/admin-credits.controller.ts
PATCH/api/v1/admin/customers/:id/event-quotaUpdate monthly event quota countersapps/api/src/admin/admin-customers.controller.ts
PATCH/api/v1/admin/customers/:id/featuresOverride per-customer feature flagsapps/api/src/admin/admin-customers.controller.ts
POST/api/v1/admin/customers/:id/impersonateIssue a short-lived read-only dashboard JWT for the customerapps/api/src/admin/admin-impersonate.controller.ts
GET/api/v1/admin/customers/:id/onboardingOnboarding submissionapps/api/src/admin/admin-customers.controller.ts
PATCH/api/v1/admin/customers/:id/planOverride plan (no Stripe touch)apps/api/src/admin/admin-customers.controller.ts
POST/api/v1/admin/customers/:id/restoreRestore a soft-deleted customerapps/api/src/admin/admin-customers.controller.ts
GET/api/v1/admin/operationsList operations with filtersapps/api/src/admin/admin-operations.controller.ts
GET/api/v1/admin/operations/:idOperation detail (request/result/error payloads)apps/api/src/admin/admin-operations.controller.ts
GET/api/v1/admin/operations/queue-linkShort-lived Bull-Board admin URL with tokenapps/api/src/admin/admin-operations.controller.ts
GET/api/v1/admin/usersList admin users (super only)apps/api/src/admin/admin-users.controller.ts
POST/api/v1/admin/usersCreate a new admin user (super only)apps/api/src/admin/admin-users.controller.ts
DELETE/api/v1/admin/users/:idDeactivate an admin userapps/api/src/admin/admin-users.controller.ts
PATCH/api/v1/admin/users/:idUpdate an admin userapps/api/src/admin/admin-users.controller.ts
GET/api/v1/analyticsGet leaderboardapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/activity-summaryGet activity summaryapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/audiencesGet audience breakdownapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/custom-eventsGet custom event trendsapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/economy-healthGet economy healthapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/economy-summaryGet economy summaryapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/engagementGet engagement metricsapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/event-countsPer-event countsapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/evolutionGet evolution timelineapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/marketplace-funnelGet marketplace funnelapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/overviewGet analytics overviewapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/popular-badgesGet popular badgesapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/popular-itemsGet popular itemsapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/retentionGet retention metricsapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/roi-metricsGet ROI metricsapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/streaksGet streak healthapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/tokensGet per-token economyapps/api/src/analytics/analytics.controller.ts
GET/api/v1/analytics/webhooksGet webhook delivery healthapps/api/src/analytics/analytics.controller.ts
GET/api/v1/auth/api-keysList all active API keys for the current customerapps/api/src/auth/auth.controller.ts
POST/api/v1/auth/api-keysCreate a new API keyapps/api/src/auth/auth.controller.ts
DELETE/api/v1/auth/api-keys/:idRevoke an API key by its IDapps/api/src/auth/auth.controller.ts
POST/api/v1/auth/api-keys/rotateRotate API keys by revoking all existing keys and creating a new oneapps/api/src/auth/auth.controller.ts
POST/api/v1/auth/loginAuthenticate and obtain a JWT tokenapps/api/src/auth/auth.controller.ts
GET/api/v1/auth/meGet the currently authenticated customer profileapps/api/src/auth/auth.controller.ts
POST/api/v1/auth/publishable-keysIssue a browser-safe publishable key (hatch_pk_*) with a scoped set of permissions.apps/api/src/auth/auth.controller.ts
POST/api/v1/auth/registerRegister a new customer accountapps/api/src/auth/auth.controller.ts
GET/api/v1/badge-definitionsList all badge definitionsapps/api/src/badge-definitions/badge-definitions.controller.ts
POST/api/v1/badge-definitionsCreate a badge definitionapps/api/src/badge-definitions/badge-definitions.controller.ts
DELETE/api/v1/badge-definitions/:idDelete a badge definitionapps/api/src/badge-definitions/badge-definitions.controller.ts
GET/api/v1/badge-definitions/:idGet a badge definitionapps/api/src/badge-definitions/badge-definitions.controller.ts
PUT/api/v1/badge-definitions/:idUpdate a badge definitionapps/api/src/badge-definitions/badge-definitions.controller.ts
POST/api/v1/badge-definitions/:id/regenerate-iconQueue an AI regeneration for this badge iconapps/api/src/badge-definitions/badge-definitions.controller.ts
POST/api/v1/badge-definitions/generate-iconGenerate a badge icon with AIapps/api/src/badge-definitions/badge-definitions.controller.ts
POST/api/v1/badge-definitions/upload-iconapps/api/src/badge-definitions/badge-definitions.controller.ts
POST/api/v1/billing/checkoutCreate checkout sessionapps/api/src/billing/billing.controller.ts
POST/api/v1/billing/override-planOverride customer planapps/api/src/billing/billing.controller.ts
POST/api/v1/billing/portalCreate billing portal sessionapps/api/src/billing/billing.controller.ts
GET/api/v1/billing/statusGet billing statusapps/api/src/billing/billing.controller.ts
POST/api/v1/billing/webhookHandle Stripe webhookapps/api/src/billing/billing.controller.ts
GET/api/v1/buddiesList buddies with pagination and optional filtersapps/api/src/buddies/buddies.controller.ts
POST/api/v1/buddies/:buddy_id/appearance/rerenderRegenerate the buddy stage base imageapps/api/src/buddies/buddies.controller.ts
GET/api/v1/buddies/:buddy_id/badgesList all badges awarded to a buddyapps/api/src/buddies/buddies.controller.ts
POST/api/v1/buddies/:buddy_id/badgesAward a badge to a buddyapps/api/src/buddies/buddies.controller.ts
POST/api/v1/buddies/:buddy_id/coinsEarn coins for a buddy (supports idempotency)apps/api/src/buddies/buddies.controller.ts
POST/api/v1/buddies/:buddy_id/coins/spendSpend coins for a buddy (supports idempotency)apps/api/src/buddies/buddies.controller.ts
PATCH/api/v1/buddies/:buddy_id/equipped-itemsEquip or unequip items on a buddyapps/api/src/buddies/buddies.controller.ts
GET/api/v1/buddies/:buddy_id/evolutionCheck evolution readiness and progress for a buddyapps/api/src/buddies/buddies.controller.ts
GET/api/v1/buddies/:buddy_id/evolutionsStage transition timeline for a buddyapps/api/src/buddies/buddies.controller.ts
POST/api/v1/buddies/:buddy_id/evolveTrigger asynchronous buddy evolutionapps/api/src/buddies/buddies.controller.ts
POST/api/v1/buddies/:buddy_id/gates/:gate_key/unlockSpend tokens to unlock a gate for a buddyapps/api/src/gates/gates.controller.ts
GET/api/v1/buddies/:buddy_id/progressionGet buddy progression metrics (legacy endpoint)apps/api/src/buddies/buddies.controller.ts
GET/api/v1/buddies/:buddy_id/progression-metricsGet buddy progression metrics (lessons, quizzes, streaks, etc.)apps/api/src/buddies/buddies.controller.ts
POST/api/v1/buddies/:buddy_id/purchase-itemPurchase a marketplace item using coins (supports idempotency)apps/api/src/buddies/buddies.controller.ts
GET/api/v1/buddies/:buddy_id/purchased-itemsList all purchased items for a buddyapps/api/src/buddies/buddies.controller.ts
GET/api/v1/buddies/:buddy_id/tokensTyped token balances (primary + progression)apps/api/src/buddies/buddies.controller.ts
POST/api/v1/buddies/:buddy_id/tokensEarn or spend tokens for a buddy (supports idempotency)apps/api/src/buddies/buddies.controller.ts
POST/api/v1/buddies/:buddy_id/unlock-itemUnlock an item without spending coinsapps/api/src/buddies/buddies.controller.ts
GET/api/v1/buddies/:buddy_id/unlocksList gates this buddy has unlockedapps/api/src/gates/gates.controller.ts
GET/api/v1/buddies/:idGet buddy details with full canonical stateapps/api/src/buddies/buddies.controller.ts
PATCH/api/v1/buddies/:idUpdate a buddy nameapps/api/src/buddies/buddies.controller.ts
PATCH/api/v1/buddies/:id/archiveArchive a buddy (one-way transition from active to archived)apps/api/src/buddies/buddies.controller.ts
PATCH/api/v1/buddies/:id/skillsUpdate buddy skill levels (increase, decrease, or set)apps/api/src/buddies/buddies.controller.ts
GET/api/v1/buddies/users/:user_id/summaryGet a user summary including buddy count, coins, and badgesapps/api/src/buddies/buddies.controller.ts
GET/api/v1/coin-rulesList all coin rulesapps/api/src/coin-rules/coin-rules.controller.ts
POST/api/v1/coin-rulesCreate a coin ruleapps/api/src/coin-rules/coin-rules.controller.ts
DELETE/api/v1/coin-rules/:idDelete a coin ruleapps/api/src/coin-rules/coin-rules.controller.ts
PUT/api/v1/coin-rules/:idUpdate a coin ruleapps/api/src/coin-rules/coin-rules.controller.ts
GET/api/v1/config-versionsList config versionsapps/api/src/config-versions/config-versions.controller.ts
POST/api/v1/config-versionsCreate config versionapps/api/src/config-versions/config-versions.controller.ts
GET/api/v1/config-versions/:idGet config versionapps/api/src/config-versions/config-versions.controller.ts
PATCH/api/v1/config-versions/:idUpdate config versionapps/api/src/config-versions/config-versions.controller.ts
POST/api/v1/config-versions/:id/cloneClone config versionapps/api/src/config-versions/config-versions.controller.ts
GET/api/v1/config-versions/:id/impactPreview config impactapps/api/src/config-versions/config-versions.controller.ts
POST/api/v1/config-versions/:id/migrate-buddiesMigrate buddiesapps/api/src/config-versions/config-versions.controller.ts
POST/api/v1/config-versions/:id/publishPublish config versionapps/api/src/config-versions/config-versions.controller.ts
GET/api/v1/credits/balanceGet credit balanceapps/api/src/credits/credits.controller.ts
GET/api/v1/credits/ledgerList recent AI usage ledger entriesapps/api/src/credits/credits.controller.ts
GET/api/v1/customers/meapps/api/src/customers/customers.controller.ts
PATCH/api/v1/customers/meapps/api/src/customers/customers.controller.ts
POST/api/v1/customers/me/apply-presetApply presetapps/api/src/presets/presets.controller.ts
POST/api/v1/customers/me/assets/regenerateBulk regenerate AI assetsapps/api/src/customers/customers.controller.ts
PATCH/api/v1/customers/me/audiencesReplace the customer audience listapps/api/src/customers/customers.controller.ts
PATCH/api/v1/customers/me/settingsapps/api/src/customers/customers.controller.ts
DELETE/api/v1/customers/me/users/:user_id/dataapps/api/src/customers/customers.controller.ts
GET/api/v1/customers/me/users/:user_id/summaryapps/api/src/buddies/customers-summary.controller.ts
POST/api/v1/customers/me/widget-theme/suggestSuggest widget theme customizationapps/api/src/customers/customers.controller.ts
POST/api/v1/demo/buddy/:id/evolveEvolve the demo visitor buddyapps/api/src/widget-sessions/demo.controller.ts
POST/api/v1/demo/eventIngest an event for the current demo visitorapps/api/src/widget-sessions/demo.controller.ts
POST/api/v1/demo/hatchHatch a buddy for the current demo visitor (instant)apps/api/src/widget-sessions/demo.controller.ts
GET/api/v1/demo/operations/:idRead the status of an async demo operationapps/api/src/widget-sessions/demo.controller.ts
POST/api/v1/demo/resetArchive the current demo visitor buddy and reset stateapps/api/src/widget-sessions/demo.controller.ts
POST/api/v1/demo/sessionStart or resume a per-visitor demo sessionapps/api/src/widget-sessions/demo.controller.ts
GET/api/v1/demo/stateRead the demo visitor state (buddy + readiness + metrics)apps/api/src/widget-sessions/demo.controller.ts
GET/api/v1/demo/widget-tokenMint embed token for the public demo tenant (primary Fern)apps/api/src/widget-sessions/demo.controller.ts
GET/api/v1/economy/buddies/:buddyId/ledgerGet coin ledger for a buddyapps/api/src/economy/economy.controller.ts
GET/api/v1/eggsList eggs with optional user and status filtersapps/api/src/eggs/eggs.controller.ts
POST/api/v1/eggsCreate a new egg for a userapps/api/src/eggs/eggs.controller.ts
GET/api/v1/eggs/:idGet an egg by its IDapps/api/src/eggs/eggs.controller.ts
POST/api/v1/eggs/:id/hatchStart the asynchronous hatch process for an eggapps/api/src/eggs/eggs.controller.ts
PATCH/api/v1/eggs/:id/statusUpdate an egg status to ready or cancelledapps/api/src/eggs/eggs.controller.ts
POST/api/v1/embed-tokensCreate embed tokenapps/api/src/widget-sessions/widget-sessions.controller.ts
GET/api/v1/event-typesList event typesapps/api/src/event-types/event-types.controller.ts
POST/api/v1/event-typesRegister an event typeapps/api/src/event-types/event-types.controller.ts
DELETE/api/v1/event-types/:idDelete an event typeapps/api/src/event-types/event-types.controller.ts
GET/api/v1/event-types/:idGet an event typeapps/api/src/event-types/event-types.controller.ts
PUT/api/v1/event-types/:idUpdate or rename an event typeapps/api/src/event-types/event-types.controller.ts
GET/api/v1/eventsList eventsapps/api/src/events/events.controller.ts
POST/api/v1/eventsIngest eventapps/api/src/events/events.controller.ts
GET/api/v1/events/:idGet eventapps/api/src/events/events.controller.ts
GET/api/v1/events/active-usersList most-active users in a recent windowapps/api/src/events/events.controller.ts
POST/api/v1/events/batchIngest event batchapps/api/src/events/events.controller.ts
GET/api/v1/events/typesList distinct event typesapps/api/src/events/events.controller.ts
GET/api/v1/gatesList token gates for this customerapps/api/src/gates/gates.controller.ts
DELETE/api/v1/gates/:gate_keyDelete a token gateapps/api/src/gates/gates.controller.ts
PUT/api/v1/gates/:gate_keyCreate or update a token gateapps/api/src/gates/gates.controller.ts
GET/api/v1/healthHealth checkapps/api/src/health/health.controller.ts
GET/api/v1/health/liveLiveness checkapps/api/src/health/health.controller.ts
GET/api/v1/health/readyReadiness checkapps/api/src/health/health.controller.ts
GET/api/v1/image-usageGet image usageapps/api/src/images/image-cost.controller.ts
GET/api/v1/image-usage/reportGet image usage reportapps/api/src/images/image-cost.controller.ts
GET/api/v1/marketplacesList marketplacesapps/api/src/marketplace/marketplace.controller.ts
POST/api/v1/marketplacesCreate marketplaceapps/api/src/marketplace/marketplace.controller.ts
GET/api/v1/marketplaces/:idGet marketplaceapps/api/src/marketplace/marketplace.controller.ts
PUT/api/v1/marketplaces/:idUpdate marketplaceapps/api/src/marketplace/marketplace.controller.ts
GET/api/v1/marketplaces/:id/itemsList itemsapps/api/src/marketplace/marketplace.controller.ts
POST/api/v1/marketplaces/:id/itemsCreate itemapps/api/src/marketplace/marketplace.controller.ts
DELETE/api/v1/marketplaces/:id/items/:item_idDelete itemapps/api/src/marketplace/marketplace.controller.ts
GET/api/v1/marketplaces/:id/items/:item_idGet itemapps/api/src/marketplace/marketplace.controller.ts
PUT/api/v1/marketplaces/:id/items/:item_idUpdate itemapps/api/src/marketplace/marketplace.controller.ts
POST/api/v1/marketplaces/:id/items/:item_id/regenerate-imageQueue an AI regeneration for this item imageapps/api/src/marketplace/marketplace.controller.ts
POST/api/v1/marketplaces/:id/items/:item_id/upload-imageUpload item imageapps/api/src/marketplace/marketplace.controller.ts
POST/api/v1/marketplaces/:id/items/importImport itemsapps/api/src/marketplace/marketplace.controller.ts
POST/api/v1/marketplaces/:id/items/reorderReorder itemsapps/api/src/marketplace/marketplace.controller.ts
GET/api/v1/metricsGet Prometheus metricsapps/api/src/health/metrics.controller.ts
POST/api/v1/onboarding/sessionsCreate or resume the current onboarding sessionapps/api/src/onboarding/onboarding.controller.ts
PUT/api/v1/onboarding/sessions/:id/answersPatch structured onboarding answersapps/api/src/onboarding/onboarding.controller.ts
POST/api/v1/onboarding/sessions/:id/applyApply the generated plan to the customer (writes gamification config)apps/api/src/onboarding/onboarding.controller.ts
POST/api/v1/onboarding/sessions/:id/generate-guideGenerate a personalized integration guideapps/api/src/onboarding/onboarding.controller.ts
POST/api/v1/onboarding/sessions/:id/generate-planGenerate a gamification plan from the conversationapps/api/src/onboarding/onboarding.controller.ts
POST/api/v1/onboarding/sessions/:id/messageSend a user message and stream the assistant reply via server-sent eventsapps/api/src/onboarding/onboarding.controller.ts
POST/api/v1/onboarding/sessions/:id/regenerate-planRegenerate the plan with a variant seedapps/api/src/onboarding/onboarding.controller.ts
GET/api/v1/onboarding/sessions/currentFetch the current onboarding sessionapps/api/src/onboarding/onboarding.controller.ts
GET/api/v1/onboarding/sessions/preparing-statusAggregate asset-generation status for the current customerapps/api/src/onboarding/onboarding.controller.ts
POST/api/v1/onboarding/sessions/resetReset the current onboarding sessionapps/api/src/onboarding/onboarding.controller.ts
POST/api/v1/onboarding/sessions/seed-from-repoSeed onboarding from a repo-analysis brief produced by a local AI agentapps/api/src/onboarding/onboarding.controller.ts
POST/api/v1/onboarding/sessions/seed-from-urlSeed onboarding from a landing-page URLapps/api/src/onboarding/onboarding.controller.ts
POST/api/v1/onboarding/sessions/waitlistJoin the waitlist for an upcoming onboarding channelapps/api/src/onboarding/onboarding.controller.ts
GET/api/v1/operationsList operations with optional type and status filtersapps/api/src/operations/operations.controller.ts
GET/api/v1/operations/:idGet an operation by its IDapps/api/src/operations/operations.controller.ts
POST/api/v1/operations/:id/cancelCancel a pending or processing operationapps/api/src/operations/operations.controller.ts
GET/api/v1/path-definitionsList path definitionsapps/api/src/paths/paths.controller.ts
POST/api/v1/path-definitionsCreate a path definitionapps/api/src/paths/paths.controller.ts
DELETE/api/v1/path-definitions/:idDelete a path definitionapps/api/src/paths/paths.controller.ts
GET/api/v1/path-definitions/:idGet a path definition (with steps + sub-steps)apps/api/src/paths/paths.controller.ts
PUT/api/v1/path-definitions/:idUpdate a path definitionapps/api/src/paths/paths.controller.ts
POST/api/v1/path-definitions/:id/activateActivate a path (atomic single-active per audience)apps/api/src/paths/paths.controller.ts
POST/api/v1/path-definitions/:id/deactivateDeactivate a pathapps/api/src/paths/paths.controller.ts
GET/api/v1/path-definitions/:id/stepsList steps in a pathapps/api/src/paths/paths.controller.ts
POST/api/v1/path-definitions/:id/stepsCreate a step in a pathapps/api/src/paths/paths.controller.ts
DELETE/api/v1/path-definitions/:id/steps/:stepIdDelete a stepapps/api/src/paths/paths.controller.ts
PUT/api/v1/path-definitions/:id/steps/:stepIdUpdate a stepapps/api/src/paths/paths.controller.ts
GET/api/v1/path-definitions/:id/steps/:stepId/sub-stepsList sub-steps within a stepapps/api/src/paths/paths.controller.ts
POST/api/v1/path-definitions/:id/steps/:stepId/sub-stepsCreate a sub-stepapps/api/src/paths/paths.controller.ts
DELETE/api/v1/path-definitions/:id/steps/:stepId/sub-steps/:subStepIdDelete a sub-stepapps/api/src/paths/paths.controller.ts
PUT/api/v1/path-definitions/:id/steps/:stepId/sub-steps/:subStepIdUpdate a sub-stepapps/api/src/paths/paths.controller.ts
PUT/api/v1/path-definitions/:id/steps/:stepId/sub-steps/reorderReorder sub-steps within a stepapps/api/src/paths/paths.controller.ts
PUT/api/v1/path-definitions/:id/steps/reorderReorder steps in a pathapps/api/src/paths/paths.controller.ts
GET/api/v1/path-definitions/buddies/:buddyId/paths/:pathKeyGet path runtime payload for a buddyapps/api/src/paths/paths.controller.ts
POST/api/v1/path-definitions/buddies/:buddyId/paths/:pathKey/sub-steps/:subKey/completeManually mark a sub-step complete (admin)apps/api/src/paths/paths.controller.ts
GET/api/v1/presetsList presetsapps/api/src/presets/presets.controller.ts
GET/api/v1/presets/:keyGet presetapps/api/src/presets/presets.controller.ts
GET/api/v1/skill-decay-rulesList skill decay rulesapps/api/src/skill-decay-rules/skill-decay-rules.controller.ts
POST/api/v1/skill-decay-rulesCreate a skill decay ruleapps/api/src/skill-decay-rules/skill-decay-rules.controller.ts
DELETE/api/v1/skill-decay-rules/:idDelete a skill decay ruleapps/api/src/skill-decay-rules/skill-decay-rules.controller.ts
PUT/api/v1/skill-decay-rules/:idUpdate a skill decay ruleapps/api/src/skill-decay-rules/skill-decay-rules.controller.ts
GET/api/v1/skill-decay-rules/:id/historyRecent decay applications for a ruleapps/api/src/skill-decay-rules/skill-decay-rules.controller.ts
GET/api/v1/skill-decay-rules/:id/previewPreview the cumulative effect of a decay ruleapps/api/src/skill-decay-rules/skill-decay-rules.controller.ts
POST/api/v1/skill-decay-rules/run-nowTrigger a decay sweep immediately for this customerapps/api/src/skill-decay-rules/skill-decay-rules.controller.ts
GET/api/v1/skill-rulesList all skill rulesapps/api/src/skill-rules/skill-rules.controller.ts
POST/api/v1/skill-rulesCreate a skill ruleapps/api/src/skill-rules/skill-rules.controller.ts
DELETE/api/v1/skill-rules/:idDelete a skill ruleapps/api/src/skill-rules/skill-rules.controller.ts
PUT/api/v1/skill-rules/:idUpdate a skill ruleapps/api/src/skill-rules/skill-rules.controller.ts
GET/api/v1/skill-setsList all skill setsapps/api/src/skill-sets/skill-sets.controller.ts
POST/api/v1/skill-setsCreate a skill setapps/api/src/skill-sets/skill-sets.controller.ts
DELETE/api/v1/skill-sets/:idDelete a skill setapps/api/src/skill-sets/skill-sets.controller.ts
GET/api/v1/skill-sets/:idGet a skill setapps/api/src/skill-sets/skill-sets.controller.ts
PUT/api/v1/skill-sets/:idUpdate a skill setapps/api/src/skill-sets/skill-sets.controller.ts
POST/api/v1/skill-sets/generate-iconGenerate a skill icon with AIapps/api/src/skill-sets/skill-sets.controller.ts
GET/api/v1/stage-assetsList per-customer stage assets (preset mode buddy art) plus the default library URLs resolved for the customer's creature_style.apps/api/src/stage-assets/stage-assets.controller.ts
DELETE/api/v1/stage-assets/:stageRemove the preset asset for a stageapps/api/src/stage-assets/stage-assets.controller.ts
PUT/api/v1/stage-assets/:stageCommit an uploaded object as the preset asset for a stageapps/api/src/stage-assets/stage-assets.controller.ts
POST/api/v1/stage-assets/:stage/regenerateQueue AI generation for a customer preset stage assetapps/api/src/stage-assets/stage-assets.controller.ts
POST/api/v1/stage-assets/upload-urlIssue a presigned PUT URL for a client-side stage asset uploadapps/api/src/stage-assets/stage-assets.controller.ts
GET/api/v1/streak-definitionsList all streak definitionsapps/api/src/streaks/streak-definitions.controller.ts
POST/api/v1/streak-definitionsCreate a streak definitionapps/api/src/streaks/streak-definitions.controller.ts
DELETE/api/v1/streak-definitions/:idDelete a streak definitionapps/api/src/streaks/streak-definitions.controller.ts
GET/api/v1/streak-definitions/:idGet a streak definitionapps/api/src/streaks/streak-definitions.controller.ts
PUT/api/v1/streak-definitions/:idUpdate a streak definitionapps/api/src/streaks/streak-definitions.controller.ts
GET/api/v1/token-configList token configurationsapps/api/src/token-config/token-config.controller.ts
POST/api/v1/token-configUpsert token configurationapps/api/src/token-config/token-config.controller.ts
GET/api/v1/webhook-configsList webhook configsapps/api/src/webhooks/webhooks.controller.ts
POST/api/v1/webhook-configsCreate webhook configapps/api/src/webhooks/webhooks.controller.ts
DELETE/api/v1/webhook-configs/:idDelete webhook configapps/api/src/webhooks/webhooks.controller.ts
GET/api/v1/webhook-configs/:idGet webhook configapps/api/src/webhooks/webhooks.controller.ts
PUT/api/v1/webhook-configs/:idUpdate webhook configapps/api/src/webhooks/webhooks.controller.ts
GET/api/v1/webhook-configs/:id/deliveriesList webhook deliveriesapps/api/src/webhooks/webhooks.controller.ts
POST/api/v1/webhook-configs/:id/deliveries/:deliveryId/redeliverRedeliver webhookapps/api/src/webhooks/webhooks.controller.ts
POST/api/v1/webhook-configs/:id/rotate-secretRotate webhook secretapps/api/src/webhooks/webhooks.controller.ts
POST/api/v1/webhook-configs/:id/testSend test webhookapps/api/src/webhooks/webhooks.controller.ts
POST/api/v1/widget-sessionsCreate session tokenapps/api/src/widget-sessions/widget-sessions.controller.ts
DELETE/api/v1/widget-sessions/:idRevoke widget sessionapps/api/src/widget-sessions/widget-sessions.controller.ts
GET/api/v1/widget-sessions/previewCreate automatic dashboard preview tokensapps/api/src/widget-sessions/widget-sessions.controller.ts
POST/api/v1/widget/appearance/rerenderRerender stage baseapps/api/src/widget-sessions/widget-api.controller.ts
GET/api/v1/widget/badgesGet widget badge catalogapps/api/src/widget-sessions/widget-api.controller.ts
GET/api/v1/widget/buddyGet widget buddyapps/api/src/widget-sessions/widget-api.controller.ts
POST/api/v1/widget/equipEquip or unequip itemsapps/api/src/widget-sessions/widget-api.controller.ts
GET/api/v1/widget/evolutionsGet widget evolution timelineapps/api/src/widget-sessions/widget-api.controller.ts
GET/api/v1/widget/marketplaceGet widget marketplaceapps/api/src/widget-sessions/widget-api.controller.ts
POST/api/v1/widget/marketplace/items/:id/track-viewTrack marketplace item impressionapps/api/src/widget-sessions/widget-api.controller.ts
GET/api/v1/widget/operations/:idGet widget operationapps/api/src/widget-sessions/widget-api.controller.ts
GET/api/v1/widget/pathGet the active path for the buddy’s audienceapps/api/src/widget-sessions/widget-api.controller.ts
GET/api/v1/widget/path/:keyGet a specific path for a buddyapps/api/src/widget-sessions/widget-api.controller.ts
POST/api/v1/widget/path/:key/sub-steps/:subKey/completeManually mark a sub-step completeapps/api/src/widget-sessions/widget-api.controller.ts
POST/api/v1/widget/purchasePurchase itemapps/api/src/widget-sessions/widget-api.controller.ts
GET/api/v1/widget/stateGet aggregate widget stateapps/api/src/widget-sessions/widget-api.controller.ts
GET/api/v1/widget/streak/:keyGet widget streakapps/api/src/widget-sessions/widget-api.controller.ts
GET/api/v1/widget/themeLive widget themeapps/api/src/widget-sessions/widget-api.controller.ts
GET/api/v1/widget/tokensGet the buddy’s token walletapps/api/src/widget-sessions/widget-api.controller.ts
POST/api/v1/widget/trackTrack event from browserapps/api/src/widget-sessions/widget-api.controller.ts