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
- Fetch the report types — call
GET /api/integration/segmentsto get every report type and your workspace default. - Pick one when you create — pass its
segmenton any of these requests:- Create Company —
POST /api/integration/project(ignored forprojectNoAnalysis, which is a bookmark) - Create Analysis —
POST /api/integration/analysis/company - Create Company & Upload —
POST /api/integrationcreateandupload/project(form fieldsegment) - Create from Google Drive —
POST /api/integrationcreateandupload/projectWithGoogleDriveLinks
- Create Company —
Rules:
segmentis 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
segmentis rejected with HTTP400(Error196,SEGMENT_INVALID) and nothing is created. Asegmentthat is not 1–50 letters, digits, hyphens or underscores is rejected with HTTP400. The request never falls back to the default.
Get Report Types
GET https://api.kruncher.ai/api/integration/segments
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Your API key (format: YOUR_API_KEY) |
Response (200 OK)
{
"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
| Field | Type | Description |
|---|---|---|
segments[].segment | string | The code to send as segment |
segments[].displayName | string | Human-readable name of the report type |
segments[].creditCost | number | null | Credits one analysis of this type costs. null means the standard 1 credit |
workspaceDefaultSegment | string | The 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
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
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
Get Report Types
curl -X GET "https://api.kruncher.ai/api/integration/segments" \
-H "Authorization: YOUR_API_KEY_HERE"Error Responses
400 Bad Request — unknown report type
{
"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.
Related Endpoints
Last updated on