Skip to Content
Docs are evolving — expect frequent updates.
ConfigConfiguration

Configuration

Get all configuration values and reference data for the Kruncher.ai platform. This endpoint provides valid options for industries, countries, business models, company stages, project statuses, and other enumerated values used throughout the API.

Endpoint

GET https://api.kruncher.ai/api/config

Headers

HeaderRequiredDescription
Content-TypeNoOptional application/json

Use Cases

When to Use Config Endpoint

  • Validation: Get valid options before creating or updating projects
  • Dropdown Menus: Populate UI dropdowns with current options
  • Status Mapping: Map status/phase codes to display names
  • ID Lookup: Find status/phase IDs for update operations
  • Reference Data: Access countries, industries, and other reference lists
  • Cache Initialization: Cache reference data at application startup

Code Examples

JavaScript/TypeScript

CODE
 
 
const response = await fetch("https://api.kruncher.ai/api/config", {
  headers: {
    "Content-Type": "application/json"
  }
});
 
const config = await response.json();
 
console.log("Project Statuses:", config.projectstatus);
console.log("Industries:", config.industries);
console.log("Countries:", config.countries);

Result: Retrieves all configuration data.

Python

CODE
import requests
 
API_KEY = "YOUR_API_KEY_HERE"
url = "https://api.kruncher.ai/api/config"
 
headers = {
    "Authorization": f"{API_KEY}",
    "Content-Type": "application/json"
}
 
response = requests.get(url, headers=headers)
 
if response.status_code == 200:
    config = response.json()
    print(f"Project Statuses: {len(config['projectstatus'])}")
    print(f"Industries: {len(config['industries'])}")
    print(f"Countries: {len(config['countries'])}")
else:
    print(f"Error: {response.status_code} {response.text}")

Result: Retrieves all configuration data.

cURL

CODE
curl -X GET "https://api.kruncher.ai/api/config" \
  -H "Authorization: YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json"

Response Structure

Success Response (200 OK)

CODE
{
  "code": "1000",
  "title": "Success",
  "projectstatus": [
    {
      "id": "status_001",
      "code": "active",
      "name": "Active",
      "order": 1,
      "isVisible": true
    },
    {
      "id": "status_002",
      "code": "screening",
      "name": "Screening",
      "order": 2,
      "isVisible": true
    },
    {
      "id": "status_003",
      "code": "dropped",
      "name": "Dropped",
      "order": 3,
      "isVisible": true
    }
  ],
  "projectphases": [
    {
      "id": "phase_001",
      "code": "undecided",
      "name": "Undecided",
      "order": 1,
      "isVisible": true
    },
    {
      "id": "phase_002",
      "code": "duediligence",
      "name": "Due Diligence",
      "order": 2,
      "isVisible": true
    },
    {
      "id": "phase_003",
      "code": "invested",
      "name": "Invested",
      "order": 3,
      "isVisible": true
    },
    {
      "id": "phase_004",
      "code": "rejected",
      "name": "Rejected",
      "order": 4,
      "isVisible": true
    }
  ],
  "industries": [
    {
      "code": "saas",
      "name": "SaaS"
    },
    {
      "code": "fintech",
      "name": "FinTech"
    },
    {
      "code": "healthtech",
      "name": "HealthTech"
    },
    {
      "code": "ecommerce",
      "name": "E-commerce"
    }
  ],
  "countries": [
    {
      "code": "US",
      "name": "United States"
    },
    {
      "code": "UK",
      "name": "United Kingdom"
    },
    {
      "code": "CA",
      "name": "Canada"
    }
  ],
  "businessModels": [
    {
      "code": "b2b",
      "name": "B2B"
    },
    {
      "code": "b2c",
      "name": "B2C"
    },
    {
      "code": "b2b2c",
      "name": "B2B2C"
    },
    {
      "code": "marketplace",
      "name": "Marketplace"
    }
  ],
  "companyStages": [
    {
      "code": "preSeed",
      "name": "Pre-Seed"
    },
    {
      "code": "seed",
      "name": "Seed"
    },
    {
      "code": "seriesA",
      "name": "Series A"
    },
    {
      "code": "seriesB",
      "name": "Series B"
    }
  ],
  "revenueRanges": [
    {
      "code": "0-100k",
      "name": "$0 - $100K"
    },
    {
      "code": "100k-1m",
      "name": "$100K - $1M"
    },
    {
      "code": "1m-10m",
      "name": "$1M - $10M"
    }
  ]
}

Configuration Sections

Project Status

Status values for project workflow:

CodeNameTypical Use
activeActiveCurrently evaluating
screeningScreeningInitial review phase
droppedDroppedNo longer pursuing
onholdOn HoldPaused evaluation
archivedArchivedHistorical record

Project Phases

Investment decision phases:

CodeNameDescription
undecidedUndecidedNot yet decided
duediligenceDue DiligenceActive investigation
investedInvestedInvestment made
rejectedRejectedPassed on opportunity
exitedExitedInvestment realized

Industries

Common industry classifications available in the platform.

Countries

ISO country codes with display names for all supported countries.

Business Models

CodeName
b2bB2B
b2cB2C
b2b2cB2B2C
marketplaceMarketplace

Company Stages

CodeName
preSeedPre-Seed
seedSeed
seriesASeries A
seriesBSeries B
seriesCSeries C
growthGrowth
ipoIPO

Revenue Ranges

Pre-defined revenue brackets for categorization.

Common Use Cases

Validate Before Create

CODE
const config = new KruncherConfig(API_KEY);
 
// Validate industry before creating company
const industry = "SaaS";
if (await config.isValidIndustry(industry)) {
  // Create company with validated industry
  await createCompany({ industry });
} else {
  console.error(`Invalid industry: ${industry}`);
}

Populate UI Dropdowns

CODE
config = KruncherConfig()
 
# Get options for form dropdowns
status_options = config.get_status_options()
phase_options = config.get_phase_options()
industry_options = config.get_industry_options()
 
# Use in UI framework
render_dropdown("status", status_options)
render_dropdown("phase", phase_options)
render_dropdown("industry", industry_options)

Find IDs for Updates

CODE
// Find status and phase IDs for update operation
const config = new KruncherConfig(API_KEY);
 
const screeningStatus = await config.getStatusByCode("screening");
const dueDiligencePhase = await config.getPhaseByCode("duediligence");
 
// Use IDs in update request
await updateProject(projectId, {
  statusId: screeningStatus.id,
  phaseId: dueDiligencePhase.id
});

Map Codes to Names

CODE
# Display friendly names from codes
config = KruncherConfig()
 
status_code = "screening"
status = config.get_status_by_code(status_code)
print(f"Status: {status['name']}")  # "Screening"
 
phase_code = "duediligence"
phase = config.get_phase_by_code(phase_code)
print(f"Phase: {phase['name']}")  # "Due Diligence"

Best Practices

Cache Configuration

  • Config data changes infrequently
  • Cache for 1 hour minimum
  • Refresh cache on application startup
  • Use force refresh only when needed

Validation

  • Always validate codes before API calls
  • Check existence before using IDs
  • Provide helpful error messages
  • Fall back to default values when appropriate

Performance

  • Fetch config once at startup
  • Share config instance across application
  • Don’t fetch on every request
  • Use in-memory cache for lookups

Error Handling

  • Handle network failures gracefully
  • Provide fallback values
  • Log cache misses
  • Retry failed fetches

Integration Examples

React Hook

CODE
import { useState, useEffect } from 'react';
 
function useKruncherConfig() {
  const [config, setConfig] = useState(null);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState(null);
 
  useEffect(() => {
    const configManager = new KruncherConfig(API_KEY);
    
    configManager.fetchConfig()
      .then(data => {
        setConfig(configManager);
        setLoading(false);
      })
      .catch(err => {
        setError(err);
        setLoading(false);
      });
  }, []);
 
  return { config, loading, error };
}
 
// Usage in component
function MyComponent() {
  const { config, loading } = useKruncherConfig();
 
  if (loading) return <div>Loading...</div>;
 
  const statuses = config.getStatuses();
  
  return (
    <select>
      {statuses.map(s => (
        <option key={s.id} value={s.code}>{s.name}</option>
      ))}
    </select>
  );
}

Django Cache

CODE
from django.core.cache import cache
from datetime import timedelta
 
def get_kruncher_config():
    """Get config with Django cache."""
    config_data = cache.get('kruncher_config')
    
    if not config_data:
        config_manager = KruncherConfig()
        config_data = config_manager.fetch_config()
        cache.set('kruncher_config', config_data, timeout=3600)
    
    return config_data
 
# Usage in view
def company_form(request):
    config = get_kruncher_config()
    industries = config.get('industries', [])
    
    return render(request, 'form.html', {
        'industries': industries
    })

Troubleshooting

Config Not Loading

  • Check API key is valid
  • Verify network connectivity
  • Check for CORS issues in browser
  • Review error response

Missing Sections

  • Different accounts may have different config sections
  • Check response structure
  • Use .get() with defaults
  • Contact support for custom config

Outdated Cache

  • Force refresh if values seem stale
  • Check cache TTL settings
  • Clear cache manually if needed
  • Consider shorter cache duration

Need Help?

  • Custom options? Contact support to add industries, statuses, etc.
  • Missing data? Check your account configuration
  • Integration issues? Review the code examples above
Last updated on