API Reference
API Overview

General API

Endpoints for general operations.

Endpoints

GET /api/analytics/metrics/system

Get System Metrics

Get detailed system metrics

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api/analytics/metrics/system" \
  -H "Content-Type: application/json"

GET /

Root Endpoint

Comprehensive service discovery endpoint with content negotiation

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/" \
  -H "Content-Type: application/json"

GET /tools

Tools Endpoint

Comprehensive tools discovery endpoint with content negotiation

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/tools" \
  -H "Content-Type: application/json"

GET /api-explorer

Serve Api Explorer

Serve interactive API explorer

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api-explorer" \
  -H "Content-Type: application/json"

GET /health

Health Check

Health check endpoint

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/health" \
  -H "Content-Type: application/json"

GET /api/health

Api Health Check

API health check endpoint

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api/health" \
  -H "Content-Type: application/json"

POST /api/onboard

Process Onboarding Email

Main endpoint for processing emails from Google Apps Script

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/onboard" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/webhook/gmail

Gmail Webhook

Gmail webhook endpoint for real-time email notifications

Responses

200: Successful Response

Examples

curl -X POST "https://api.altsportsdata.com/api/webhook/gmail" \
  -H "Content-Type: application/json"

GET /api/stats

Get Stats

Get comprehensive system statistics for frontend

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api/stats" \
  -H "Content-Type: application/json"

POST /api/feedback

Submit Feedback

Submit feedback for improving triage and responses

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/feedback" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/league/{league_id}"}

Get League Status

Get onboarding status for a specific league

Parameters

NameInTypeRequiredDescription
league_idpathstringYes-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/league/{league_id}"}" \
  -H "Content-Type: application/json"

GET /api/player-headshots/{player_id}"}

Get Player Headshot

Serve player headshot images by player ID

Parameters

NameInTypeRequiredDescription
player_idpathstringYes-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/player-headshots/{player_id}"}" \
  -H "Content-Type: application/json"

GET /api/betting/opportunities

Get Betting Opportunities

Get betting opportunities with filters and pagination

Parameters

NameInTypeRequiredDescription
pagequeryintegerNo-
limitqueryintegerNo-
leaguequerystringNo-
sportquerystringNo-
statusquerystringNo-
searchquerystringNo-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/betting/opportunities" \
  -H "Content-Type: application/json"

GET /api/betting/live

Get Live Opportunities

Get live betting opportunities

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api/betting/live" \
  -H "Content-Type: application/json"

POST /api/betting/place

Place Bet

Place a bet (mock implementation for now)

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/betting/place" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/betting/user/{user_id}"}/bets

Get User Bets

Get user's betting history

Parameters

NameInTypeRequiredDescription
user_idpathstringYes-
limitqueryintegerNo-
offsetqueryintegerNo-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/betting/user/{user_id}"}/bets" \
  -H "Content-Type: application/json"

GET /api/betting/opportunities/{opportunity_id}"}

Get Betting Opportunity

Get detailed information about a specific betting opportunity

Parameters

NameInTypeRequiredDescription
opportunity_idpathstringYes-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/betting/opportunities/{opportunity_id}"}" \
  -H "Content-Type: application/json"

POST /respond

Process Email Respond

Process email - main endpoint tested by evaluation

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/respond" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/agents

Get Agents

Get available agents information

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api/agents" \
  -H "Content-Type: application/json"

GET /api/analytics

Get Analytics

Get system analytics data

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api/analytics" \
  -H "Content-Type: application/json"

POST /api/sports-intelligence

Sports Intelligence Chat

Sports Intelligence Chat Endpoint

This endpoint provides intelligent orchestration for sports-related queries, routing them to appropriate handlers (direct answers, RAG search, workflow kickoff) with credit-based access control.

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/sports-intelligence" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/prompts/search

Search Prompts

Search prompts by query with optional semantic search

Parameters

NameInTypeRequiredDescription
qquerystringNo-
semanticquerybooleanNo-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/prompts/search" \
  -H "Content-Type: application/json"

GET /api/prompts/{prompt_id}"}

Get Prompt

Get specific prompt by ID

Parameters

NameInTypeRequiredDescription
prompt_idpathstringYes-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/prompts/{prompt_id}"}" \
  -H "Content-Type: application/json"

PUT /api/prompts/{prompt_id}"}

Update Prompt

Update existing prompt

Parameters

NameInTypeRequiredDescription
prompt_idpathstringYes-
contentquerystringNo-
namequerystringNo-
descriptionquerystringNo-

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X PUT "https://api.altsportsdata.com/api/prompts/{prompt_id}"}" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/prompts/build

Build Comprehensive Prompt

Build complete prompt with recipe + agent + context + examples + schema

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/prompts/build" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/prompts

Create Prompt

Create new prompt

Parameters

NameInTypeRequiredDescription
namequerystringYes-
contentquerystringYes-
prompt_typequerystringNo-
descriptionquerystringNo-

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/prompts" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/prompts/stats

Get Prompt Stats

Get prompt collection statistics

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api/prompts/stats" \
  -H "Content-Type: application/json"

POST /api/prompts/seed

Initialize Unified System

Initialize/re-initialize the unified LangMem system from seeds

Responses

200: Successful Response

Examples

curl -X POST "https://api.altsportsdata.com/api/prompts/seed" \
  -H "Content-Type: application/json"

GET /api/prompts/langmem/status

Get Unified System Status

Get status of unified LangMem system

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api/prompts/langmem/status" \
  -H "Content-Type: application/json"

POST /api/prompts/langmem/build

Build Intelligent Prompt

Build intelligent prompt using unified LangMem with smart fallback

Parameters

NameInTypeRequiredDescription
queryquerystringYes-
business_tierquerystringNo-
scenarioquerystringNo-
max_examplesqueryintegerNo-

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/prompts/langmem/build" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/prompts/langmem/examples/{tier}"}

Get Examples By Tier Smart

Get few-shot examples by business tier with smart fallback

Parameters

NameInTypeRequiredDescription
tierpathstringYes-
scenarioquerystringNo-
limitqueryintegerNo-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/prompts/langmem/examples/{tier}"}" \
  -H "Content-Type: application/json"

GET /api/prompts/langmem/agents

List Available Agents

List all available agents with their capabilities

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api/prompts/langmem/agents" \
  -H "Content-Type: application/json"

GET /api/prompts/seed-sources

Check Seed Sources

Check what source data is available for seeding

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api/prompts/seed-sources" \
  -H "Content-Type: application/json"

GET /api/credits/{user_id}"}

Get User Credits Endpoint

Get user's current credit balance

Parameters

NameInTypeRequiredDescription
user_idpathstringYes-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/credits/{user_id}"}" \
  -H "Content-Type: application/json"

POST /api/credits/{user_id}"}/check

Check Credits Endpoint

Check if user has sufficient credits for a query type

Parameters

NameInTypeRequiredDescription
user_idpathstringYes-
query_typequerystringNo-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/credits/{user_id}"}/check" \
  -H "Content-Type: application/json"

GET /api/credits/packages

Get Credit Packages

Get available credit packages

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api/credits/packages" \
  -H "Content-Type: application/json"

GET /api/credits/{user_id}"}/transactions

Get Credit Transactions

Get credit transaction history for a user

Parameters

NameInTypeRequiredDescription
user_idpathstringYes-
limitqueryintegerNo-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/credits/{user_id}"}/transactions" \
  -H "Content-Type: application/json"

GET /api/credits/{user_id}"}/balance

Get Credit Balance

Get current credit balance for a user

Parameters

NameInTypeRequiredDescription
user_idpathstringYes-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/credits/{user_id}"}/balance" \
  -H "Content-Type: application/json"

POST /api/credits/{user_id}"}/purchase

Initiate Credit Purchase

Initiate credit purchase (creates Stripe checkout session)

Parameters

NameInTypeRequiredDescription
user_idpathstringYes-

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/credits/{user_id}"}/purchase" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/credits/{user_id}"}/add

Add Credits Endpoint

Add credits to user account (admin endpoint)

Parameters

NameInTypeRequiredDescription
user_idpathstringYes-
amountquerynumberYes-
descriptionquerystringNo-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/credits/{user_id}"}/add" \
  -H "Content-Type: application/json"

POST /api/stripe/webhook

Stripe Webhook

Handle Stripe webhook events

Responses

200: Successful Response

Examples

curl -X POST "https://api.altsportsdata.com/api/stripe/webhook" \
  -H "Content-Type: application/json"

POST /process-email

Process Email

Process incoming email

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/process-email" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /employees

Get Employees

Get all employees

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/employees" \
  -H "Content-Type: application/json"

POST /employees

Create Employee

Create a new employee

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/employees" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /employees/{employee_id}"}

Get Employee

Get a specific employee

Parameters

NameInTypeRequiredDescription
employee_idpathintegerYes-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/employees/{employee_id}"}" \
  -H "Content-Type: application/json"

PUT /employees/{employee_id}"}

Update Employee

Update an employee

Parameters

NameInTypeRequiredDescription
employee_idpathintegerYes-

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X PUT "https://api.altsportsdata.com/employees/{employee_id}"}" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /query-history

Get Query History

Get query history

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/query-history" \
  -H "Content-Type: application/json"

POST /query-history

Log Query

Log a new query

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/query-history" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /query-history/stats

Get Query Stats

Get query statistics

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/query-history/stats" \
  -H "Content-Type: application/json"

GET /data-catalog

Get Data Catalog

Get data catalog with available datasets

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/data-catalog" \
  -H "Content-Type: application/json"

GET /data-catalog/{dataset_id}"}

Get Dataset Info

Get detailed information about a specific dataset

Parameters

NameInTypeRequiredDescription
dataset_idpathstringYes-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/data-catalog/{dataset_id}"}" \
  -H "Content-Type: application/json"

POST /data-catalog/validate

Validate Dataset

Validate a dataset

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/data-catalog/validate" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /rag-query

Process Rag Query

Process a RAG query

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/rag-query" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /rag-query/status

Get Rag Status

Get RAG system status

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/rag-query/status" \
  -H "Content-Type: application/json"

GET /documents

Get Documents

Get all processed documents

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/documents" \
  -H "Content-Type: application/json"

POST /process-document

Process Document

Process a document

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/process-document" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /documents/{document_id}"}

Get Document

Get a specific document

Parameters

NameInTypeRequiredDescription
document_idpathintegerYes-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/documents/{document_id}"}" \
  -H "Content-Type: application/json"

POST /documents/{document_id}"}/reprocess

Reprocess Document

Reprocess a document

Parameters

NameInTypeRequiredDescription
document_idpathintegerYes-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/documents/{document_id}"}/reprocess" \
  -H "Content-Type: application/json"

GET /api/pipeline/view

Get Pipeline View

Get current pipeline state with sorting and filtering

Parameters

NameInTypeRequiredDescription
sort_byquerystringNo-
sort_orderquerystringNo-
stage_filterquerystringNo-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/pipeline/view" \
  -H "Content-Type: application/json"

POST /api/pipeline/stage-change

Change Pipeline Stage

Handle manual stage changes (drag and drop)

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/pipeline/stage-change" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/pipeline/process-email

Process Email For Pipeline

Process email and update pipeline automatically

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/pipeline/process-email" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/onboard-enhanced

Process Onboarding Email Enhanced

Enhanced email processing that also updates the pipeline

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/onboard-enhanced" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/contract/generate-terms

Generate Contract Terms Api

Generate contract terms based in league profile

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/contract/generate-terms" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/contract/generate-document

Generate Contract Document Api

Generate contract document from terms

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/contract/generate-document" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/contract/templates

Get Contract Templates Api

Get available contract templates

Responses

200: Successful Response

Examples

curl -X GET "https://api.altsportsdata.com/api/contract/templates" \
  -H "Content-Type: application/json"

POST /api/youtube/extract

Extract Youtube Data

Extract data from YouTube video for sports analysis

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/youtube/extract" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/youtube/predict

Predict Sports Outcome

Generate sports predictions and statistics from video data

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/youtube/predict" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/youtube/time-series

Extract Time Series

Extract time series data from YouTube video with configurable sampling

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/youtube/time-series" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/youtube/analyze-batch

Analyze Youtube Batch

Analyze multiple YouTube URLs in batch

Parameters

NameInTypeRequiredDescription
sport_overridequerystringNo-

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X POST "https://api.altsportsdata.com/api/youtube/analyze-batch" \
  -H "Content-Type: application/json" \
  -d '{}'

Platform

Documentation

Community

Support

partnership@altsportsdata.comdev@altsportsleagues.ai

2025 Β© AltSportsLeagues.ai. Powered by AI-driven sports business intelligence.

πŸ€– AI-Enhancedβ€’πŸ“Š Data-Drivenβ€’βš‘ Real-Time