Create Company
Create a new company (project) in Kruncher can be done in three different ways.
Three ways to create a company:
-
projectAnalysisWithFile
Creates a project intended for file-based analysis. -
projectAnalysisNoFile
Runs analysis using the website only. -
projectNoAnalysis
Creates a project without analysis.
Endpoint
POST https://api.kruncher.ai/api/integration/project
Request body
{
"name": "Your Company Nickname",
"companyName": "Your Company Name",
"companyWebsite": "https://yourcompany.com",
"projectType": "projectAnalysisWithFile",
"docLink": "https://example.com/document.pdf",
"email": "user@example.com",
"password": "password123",
"notesText": "Additional notes about the company..."
}Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Optional | Project nickname (optional). |
companyName | string | Required | Full legal/company name. |
companyWebsite | string (URL) | Required when projectType is projectAnalysisNoFile, otherwise optional | Company website URL. |
projectType | string | Required | Controls whether analysis is triggered. See Three ways to create a company below. |
docLink | string (URL) | Optional | Public document URL. When provided with projectAnalysisWithFile, the file is downloaded and analyzed automatically. |
email | string | Optional | Credential for accessing protected docLink URLs. |
password | string | Optional | Credential for accessing protected docLink URLs. |
notesText | string | Optional | Free-text notes that are converted into a file and used for analysis. |
Behavior notes
-
For
projectAnalysisWithFile:docLinkdownloads and triggers analysisnotesTextcreates a file and triggers analysis- If neither is provided, upload is manual
-
For
projectAnalysisNoFile:companyWebsiteis required- Other file fields are ignored
Code Examples
JavaScript/TypeScript
Basic
const apiKey = "YOUR_API_KEY_HERE";
const response = await fetch("https://api.kruncher.ai/api/integration/project", {
method: "POST",
headers: {
"Authorization": `${apiKey}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Acme",
companyName: "Acme Corporation",
companyWebsite: "https://acme.com",
projectType: "projectAnalysisNoFile"
})
});
const { project, analysisId } = await response.json();
console.log("Project created:", project.id);
console.log("Analysis ID:", analysisId);Result: Website-based analysis is triggered automatically.
Python
Basic
import requests
API_KEY = "YOUR_API_KEY_HERE"
url = "https://api.kruncher.ai/api/integration/project"
headers = {
"Authorization": f"{API_KEY}",
"Content-Type": "application/json"
}
data = {
"name": "Acme",
"companyName": "Acme Corporation",
"companyWebsite": "https://acme.com",
"projectType": "projectAnalysisNoFile"
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(f"Project created: {result['project']['id']}")
print(f"Analysis ID: {result['analysisId']}")Result: Website-based analysis is triggered.
cURL
Website Only
curl -X POST "https://api.kruncher.ai/api/integration/project" \
-H "Authorization: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme",
"companyName": "Acme Corporation",
"companyWebsite": "https://acme.com",
"projectType": "projectAnalysisNoFile"
}'Response
Returns the project and analysis ID.
{
"project": {
"id": "proj_123",
"name": "Acme",
"companyName": "Acme Corporation",
"companyWebsite": "https://acme.com",
"projectType": "projectAnalysisWithFile"
},
"analysisId": "analysis_456"
}Last updated on