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

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

CODE
{
  "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

FieldTypeRequiredDescription
namestringOptionalProject nickname (optional).
companyNamestringRequiredFull legal/company name.
companyWebsitestring (URL)Required when projectType is projectAnalysisNoFile, otherwise optionalCompany website URL.
projectTypestringRequiredControls whether analysis is triggered. See Three ways to create a company below.
docLinkstring (URL)OptionalPublic document URL. When provided with projectAnalysisWithFile, the file is downloaded and analyzed automatically.
emailstringOptionalCredential for accessing protected docLink URLs.
passwordstringOptionalCredential for accessing protected docLink URLs.
notesTextstringOptionalFree-text notes that are converted into a file and used for analysis.
folderLinkstringOptionalGoogle 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.
folderNamestringOptionalFolder 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.
driveProviderstringOptional, 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:

    • docLink downloads and triggers analysis
    • notesText creates a file and triggers analysis
    • If neither is provided, upload is manual
  • For projectAnalysisNoFile:

    • companyWebsite is 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 folderLink or folderName resolves to a real folder:
    1. The project is linked to that folder (same effect as linking manually via the Connector UI).
    2. On projectType: "projectAnalysisWithFile" or "projectAnalysisNoFile", if the folder has files, they’re fetched and analyzed immediately as part of this request (merged with any docLink/notesText-derived files). If no files are found, those project types fall back to their existing behavior unchanged.
    3. 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). Possible status values: 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 (projectAnalysisWithFile with no files at all), the link outcome is also included inline in the response body as driveFolderLink.

Code Examples

JavaScript/TypeScript

CODE
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

CODE
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

CODE
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.

CODE
{
  "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.

Last updated on