Contract Generation API
Endpoints for contract generation operations.
Endpoints
- POST /api/contracts/generate
- POST /api/contracts/format
- GET /api/contracts/templates
- POST /api/contracts/generate-terms
- POST /api/contracts/generate-document
- POST /api/contracts/scorecard
- POST /api/contracts/scorecard/update
- POST /api/contracts/pipeline/status
- GET /api/contracts/pipeline/status
- POST /api/contracts/template-injection
- POST /api/contracts/adjust-terms
- POST /api/contracts/fingerprints/create
- POST /api/contracts/interactive/start
- POST /api/contracts/interactive/session_id"}/select
- GET /api/contracts/interactive/session_id"}/download
- GET /api/contracts/health
POST /api/contracts/generate
Generate Contracts
Generate contracts from league questionnaire documents.
This endpoint processes league questionnaire data through the enhanced 3-part pipeline:
- Document ingestion and JSON conversion
- Data enhancement, classification, and market intelligence
- 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
aggressiveness_level | query | string | No | - |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template_tier | query | string | No | - |
output_format | query | string | No | - |
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:
- Data Extraction, 2. Data Transformation, 3. Data Enhancement,
- Data Classification, 5. Data Integration, 6. Template Injection
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pipeline_id | query | string | No | Pipeline 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:
- Data Extraction, 2. Data Transformation, 3. Data Enhancement,
- Data Classification, 5. Data Integration, 6. Template Injection
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pipeline_id | query | string | No | Pipeline 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
session_id | path | string | Yes | - |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
session_id | path | string | Yes | - |
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"