API Reference

API Reference

Base URL

Production: https://vip.betbitsports.com/api


Authentication

Most endpoints require a JWT Bearer token in the Authorization header:

Authorization: Bearer <jwt_token>

Tokens are issued on signup and login.


Endpoints

Health Check

GET /health

Returns server status. No authentication required.

Response:

{
  "status": "ok",
  "timestamp": "2026-03-09T12:00:00.000Z"
}

Authentication

Sign Up

Creates a new user account.

Body:

Response: User object + JWT token.

Login

Body:

Response: User object + JWT token + wallet credentials (if linked).

Link Wallet

Links a smart wallet address and passkey credentials to the authenticated user. Called after passkey registration.

Body:


Wagers

Create Wager Metadata

Stores off-chain metadata and generates a shareable link. Called before the on-chain createWager transaction.

Body:

Response:

Get Wager

Returns wager metadata merged with on-chain state.

Link On-Chain Wager ID

After the on-chain createWager transaction confirms, links the real wagerId to the metadata.

Body:

Submit Outcome Description

Stores an optional text description alongside the on-chain outcome submission.

Body:


Invites

Get Invite

Returns wager details for the shareable invite page. No authentication required.


Users

Get User Profile

Update User Profile

Body:


Database Schema

Data Model

The backend stores six tables of off-chain data:

  • users: Wallet address, passkey credentials, email, display name, notification preferences

  • wager_metadata: Descriptions, metadata hash (matches on-chain keccak256), creator address, deadlines

  • shareable_links: Invite slugs mapped to wager IDs with signed tokens

  • mediator_tokens: Time-limited, address-bound tokens for dispute resolution

  • outcome_descriptions: Optional text descriptions accompanying outcome submissions

  • notification_log: Audit trail for notifications sent across channels


Rate Limits

All API endpoints are rate-limited per IP. Authentication endpoints have stricter limits to prevent brute force attacks. Rate limit responses return HTTP 429.

Last updated