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. |
folderLink | string | Optional | Google Drive folder URL or bare folder ID (e.g. https://drive.google.com/drive/folders/1AbC-def_23 or 1AbC-def_23). Auto-links the project to this folder on creation. Takes priority over folderName if both given. |
folderName | string | Optional | Folder name to search for at the root of the connected Drive. Used only if folderLink isn’t provided. Name search is not guaranteed unique or exhaustive (whole-Drive search, capped results) — prefer folderLink when available. |
driveProvider | string | Optional, default "google-drive" | One of "google-drive", "one-drive", "sharepoint". Only "google-drive" is supported today — the others are accepted for forward compatibility and resolve to provider_not_supported with no action taken. |
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
Auto-linking a Google Drive folder
folderLink, folderName, and driveProvider work together to link a project to an existing Google Drive folder on creation, and optionally pull in its files for a first analysis. The folder must already exist in the Drive account connected under the same API-key user.
Note: a Drive folder can be linked to only one project at a time. If the folder is already linked elsewhere, linking resolves to linked_to_other_project and no action is taken on this project.
- If
folderLinkorfolderNameresolves to a real folder:- The project is linked to that folder (same effect as linking manually via the Connector UI).
- On
projectType: "projectAnalysisWithFile"or"projectAnalysisNoFile", if the folder has files, they’re fetched and analyzed immediately as part of this request (merged with anydocLink/notesText-derived files). If no files are found, those project types fall back to their existing behavior unchanged. projectType: "projectNoAnalysis"only links the folder — never triggers analysis, regardless of files present.
- After this first request, files added to the folder later are picked up by the normal ongoing Connector sync, not by these parameters.
- Link outcome is written to the project’s
extraConfig.driveFolderLink(fetch it via a project GET). Possiblestatusvalues:linked,already_linked,linked_to_other_project,not_found,ambiguous_folder(name-search only),no_connection,provider_not_supported,search_failed,error. - For the file-less bookmark case (
projectAnalysisWithFilewith no files at all), the link outcome is also included inline in the response body asdriveFolderLink.
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 { data: { 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['data']['project']['id']}")
print(f"Analysis ID: {result['data']['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 nested under data.
{
"metadata": {
"code": "1000",
"title": "Successful",
"description": ""
},
"data": {
"project": {
"id": "9dbffe0a-2f31-4632-95df-2d2b72066e34",
"name": "Acme",
"companyName": "Acme Corporation",
"companyWebsite": "https://acme.com",
"projectType": "projectAnalysisWithFile"
},
"analysisId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}The new project’s ID is at data.project.id. Use data.analysisId as the analysisid header when uploading files to /api/integrationfiles/upload.
If folderLink/folderName was given, the link outcome is written to project.extraConfig.driveFolderLink (fetch a fresh copy via a project GET). For projectAnalysisWithFile with no files found in the folder, that outcome is also returned inline as data.driveFolderLink.