API Reference
Contract Generation

Contract Generation API

Endpoints for contract generation operations.

Endpoints

POST /api/contracts/generate

Generate Contracts

Generate contracts from league questionnaire documents.

This endpoint processes league questionnaire data through the enhanced 3-part pipeline:

  1. Document ingestion and JSON conversion
  2. Data enhancement, classification, and market intelligence
  3. Contract generation in multiple formats (MD, DOCX, PDF)

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

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

POST /api/contracts/format

Format Contract

Format existing contract data into different output formats.

This endpoint takes processed contract data and generates formatted outputs in markdown, DOCX, or PDF formats.

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

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

GET /api/contracts/templates

Get Contract Templates

Get available contract templates and their configurations.

Returns information about available contract templates, tier definitions, and classification frameworks used in contract generation.

Responses

200: Successful Response

Examples

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

POST /api/contracts/generate-terms

Generate Contract Terms

Generate contract terms based on league profile and aggressiveness settings.

Parameters

NameInTypeRequiredDescription
aggressiveness_levelquerystringNo-

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

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

POST /api/contracts/generate-document

Generate Contract Document

Generate contract document from terms using templates.

Parameters

NameInTypeRequiredDescription
template_tierquerystringNo-
output_formatquerystringNo-

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

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

POST /api/contracts/scorecard

Calculate League Scorecard

Calculate league scorecard and tier classification from questionnaire data.

This endpoint processes league questionnaire data to generate:

  • Market potential, data quality, betting readiness scores
  • Fan engagement and operational maturity metrics
  • Overall tier classification (1.1-5.1)
  • Recommended interest/aggressiveness level

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

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

POST /api/contracts/scorecard/update

Update Scorecard From Sliders

Update league scorecard based on slider parameter changes.

This endpoint recalculates scorecard values when users adjust sliders, providing real-time updates to contract terms and recommendations.

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

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

POST /api/contracts/pipeline/status

Get Pipeline Status

Get status of the progressive contract generation pipeline.

Returns current stage, progress percentage, and details for each of the 6 stages:

  1. Data Extraction, 2. Data Transformation, 3. Data Enhancement,
  2. Data Classification, 5. Data Integration, 6. Template Injection

Parameters

NameInTypeRequiredDescription
pipeline_idquerystringNoPipeline run ID

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

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

GET /api/contracts/pipeline/status

Get Pipeline Status

Get status of the progressive contract generation pipeline.

Returns current stage, progress percentage, and details for each of the 6 stages:

  1. Data Extraction, 2. Data Transformation, 3. Data Enhancement,
  2. Data Classification, 5. Data Integration, 6. Template Injection

Parameters

NameInTypeRequiredDescription
pipeline_idquerystringNoPipeline run ID

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/contracts/pipeline/status" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/contracts/template-injection

Inject Contract Into Template

Inject generated contract terms into professional legal templates.

This endpoint performs the final stage of contract generation:

  • AI-merging terms with legal templates
  • Compliance checking and validation
  • Document assembly and formatting
  • Returns final professional contract document

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

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

POST /api/contracts/adjust-terms

Adjust Contract Terms

Adjust contract terms based on aggressiveness level and specific adjustments.

This endpoint recalculates contract terms when users want to be more or less favorable to the league or AltSportsData. It applies financial multipliers, duration changes, and support level modifications.

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

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

POST /api/contracts/fingerprints/create

Create Fingerprint

Create a league fingerprint from uploaded questionnaire file. This endpoint processes PDF/DOCX files to extract league information.

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

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

POST /api/contracts/interactive/start

Start Interactive Session

Start an interactive contract generation session.

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

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

POST /api/contracts/interactive/{session_id}"}/select

Select Interactive Option

Select an AI-generated option for the interactive contract session.

Parameters

NameInTypeRequiredDescription
session_idpathstringYes-

Request Body

{}

Responses

200: Successful Response

422: Validation Error

Examples

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

GET /api/contracts/interactive/{session_id}"}/download

Download Contract

Download the final contract as a PDF.

Parameters

NameInTypeRequiredDescription
session_idpathstringYes-

Responses

200: Successful Response

422: Validation Error

Examples

curl -X GET "https://api.altsportsdata.com/api/contracts/interactive/{session_id}"}/download" \
  -H "Content-Type: application/json"

GET /api/contracts/health

Contract Service Health

Check health status of contract generation services.

Responses

200: Successful Response

Examples

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

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