Skip to Content
Docs are evolving — expect frequent updates.
CompanyReport Types

Report Types

A report type decides which report a full analysis produces (for example a venture report or a private-equity report) and how many credits it costs. Each report type has a segment code. The list is configured per environment, so always read it from the API instead of hardcoding it.

How It Works

  1. Fetch the report types — call GET /api/integration/segments to get every report type and your workspace default.
  2. Pick one when you create — pass its segment on any of these requests:

Rules:

  • segment is optional. When you omit it, the analysis uses the default report type of the company’s pipeline stage if one is configured, otherwise your workspace default (workspaceDefaultSegment).
  • Any user who can create companies may pick any listed report type.
  • An unknown segment is rejected with HTTP 400 (Error196, SEGMENT_INVALID) and nothing is created. A segment that is not 1–50 letters, digits, hyphens or underscores is rejected with HTTP 400. The request never falls back to the default.

Get Report Types

GET https://api.kruncher.ai/api/integration/segments

Headers

HeaderRequiredDescription
AuthorizationYesYour API key (format: YOUR_API_KEY)

Response (200 OK)

CODE
{
  "metadata": {
    "code": "1000",
    "title": "Successful",
    "description": ""
  },
  "data": {
    "segments": [
      { "segment": "default", "displayName": "Venture Capital", "creditCost": 1 },
      { "segment": "privateEquity", "displayName": "Private Equity", "creditCost": 2 }
    ],
    "workspaceDefaultSegment": "default"
  }
}

Fields

FieldTypeDescription
segments[].segmentstringThe code to send as segment
segments[].displayNamestringHuman-readable name of the report type
segments[].creditCostnumber | nullCredits one analysis of this type costs. null means the standard 1 credit
workspaceDefaultSegmentstringThe report type used when you omit segment and the company’s stage has no default of its own

The values above are examples. Your environment returns its own list.


Code Examples

JavaScript/TypeScript

CODE
const API_KEY = "YOUR_API_KEY_HERE";
const BASE_URL = "https://api.kruncher.ai/api";
 
const headers = {
  "Authorization": API_KEY,
  "Content-Type": "application/json"
};
 
const typesResponse = await fetch(`${BASE_URL}/integration/segments`, { headers });
const { data: { segments, workspaceDefaultSegment } } = await typesResponse.json();
 
segments.forEach(s => console.log(`${s.segment}: ${s.displayName} (${s.creditCost ?? 1} credits)`));
 
const reportType = segments.find(s => s.segment === "privateEquity") ?? { segment: workspaceDefaultSegment };
 
const response = await fetch(`${BASE_URL}/integration/project`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    companyName: "Acme Corporation",
    companyWebsite: "https://acme.com",
    projectType: "projectAnalysisNoFile",
    segment: reportType.segment
  })
});

Python

CODE
import requests
 
API_KEY = "YOUR_API_KEY_HERE"
BASE_URL = "https://api.kruncher.ai/api"
headers = {"Authorization": API_KEY, "Content-Type": "application/json"}
 
types = requests.get(f"{BASE_URL}/integration/segments", headers=headers).json()["data"]
for t in types["segments"]:
    print(f"{t['segment']}: {t['displayName']} ({t['creditCost'] or 1} credits)")
 
response = requests.post(
    f"{BASE_URL}/integration/project",
    headers=headers,
    json={
        "companyName": "Acme Corporation",
        "companyWebsite": "https://acme.com",
        "projectType": "projectAnalysisNoFile",
        "segment": "privateEquity",
    },
)

cURL

CODE
curl -X GET "https://api.kruncher.ai/api/integration/segments" \
  -H "Authorization: YOUR_API_KEY_HERE"

Error Responses

400 Bad Request — unknown report type

CODE
{
  "metadata": {
    "code": "Error196",
    "title": "Report type unavailable",
    "description": "That report type does not exist or is not available yet. Pick one of the report types listed in your settings."
  }
}

Returned by the create endpoints when segment is not one of the listed report types. Fetch the list again and retry with a listed segment, or omit it to use the default.

401 Not Authorized

Returned when the API key in the Authorization header is invalid.

Last updated on