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

Create Company & Upload

Create a company and upload its documents in a single multipart request. Kruncher creates the company, creates an analysis, attaches the files, and starts processing.

Compared with the two-step flow (Create CompanyUpload Files) this saves a round trip and removes the risk of an orphaned analysis when the upload step fails.

Endpoint

POST https://api.kruncher.ai/api/integrationcreateandupload/project

Headers

HeaderRequiredDescription
AuthorizationYesYour API key (format: YOUR_API_KEY)
Content-TypeYesmultipart/form-data — set automatically by your HTTP client

Form Fields

FieldTypeRequiredDescription
companyNametextYesCompany name
companyWebsitetextYes*Company website. Used to match an existing company; also the analysis source when no files are sent
filesfileNoOne or more documents. Repeat the field for multiple files
contenttextNoRaw text to analyse alongside the files (requires contentType)
contentTypetextNoThe type of content, e.g. text/plain, text/html
projectIdtextNoAdd a new analysis to this existing company instead of creating one

* Either companyWebsite, at least one file, or content + contentType must be present — otherwise there is nothing to analyse.

Supported File Formats

PDF, DOCX/DOC, PPTX/PPT, XLSX/XLS, TXT, MD — the same set as Upload Files.

How the Company Is Resolved

You sendResult
projectIdThat company is reused, and a new analysis is added to it
No projectId, website matches an existing companyThe existing company is reused, and a new analysis is added
No projectId, website is newA new company and analysis are created

That makes the endpoint safe to retry and safe to run from an automated feed: you will not accumulate duplicate companies for the same website.

Cost & Timing

Every call starts an analysis: 1 credit, typically 15–20 minutes. Use Webhooks to be notified on completion rather than polling.

Quick Start

CODE
curl -X POST "https://api.kruncher.ai/api/integrationcreateandupload/project" \
  -H "Authorization: YOUR_API_KEY_HERE" \
  -F "companyName=Acme Corporation" \
  -F "companyWebsite=https://acme.com" \
  -F "files=@pitch-deck.pdf" \
  -F "files=@financials.xlsx"

Code Examples

Python

CODE
import requests
 
API_KEY = "YOUR_API_KEY_HERE"
BASE_URL = "https://api.kruncher.ai/api"
 
url = f"{BASE_URL}/integrationcreateandupload/project"
 
data = {
    "companyName": "Acme Corporation",
    "companyWebsite": "https://acme.com",
}
 
with open("pitch-deck.pdf", "rb") as deck:
    files = [("files", ("pitch-deck.pdf", deck))]
    response = requests.post(
        url,
        headers={"Authorization": f"{API_KEY}"},
        data=data,
        files=files,
    )
 
response.raise_for_status()
print(response.json())

JavaScript/Node.js

CODE
const fs = require('fs');
const FormData = require('form-data');
const fetch = require('node-fetch');
 
const API_KEY = "YOUR_API_KEY_HERE";
const BASE_URL = "https://api.kruncher.ai/api";
 
async function createAndUpload(companyName, companyWebsite, filePaths = []) {
  const form = new FormData();
  form.append('companyName', companyName);
  form.append('companyWebsite', companyWebsite);
 
  filePaths.forEach((filePath) => {
    if (!fs.existsSync(filePath)) {
      throw new Error(`File not found: ${filePath}`);
    }
    form.append('files', fs.createReadStream(filePath));
  });
 
  const response = await fetch(`${BASE_URL}/integrationcreateandupload/project`, {
    method: 'POST',
    headers: {
      'Authorization': `${API_KEY}`,
      ...form.getHeaders()
    },
    body: form
  });
 
  const body = await response.json();
 
  if (!response.ok || body.metadata?.code !== "1000") {
    throw new Error(`Create failed: ${body.metadata?.description || response.statusText}`);
  }
 
  return body.data;
}
 
// Usage
const result = await createAndUpload(
  "Acme Corporation",
  "https://acme.com",
  ["pitch-deck.pdf", "financials.xlsx"]
);
 
console.log("Analysis started:", result);

Response

Success Response (200 OK)

CODE
{
  "metadata": {
    "code": "1000",
    "title": "Successful",
    "description": ""
  },
  "data": {
    "project": {
      "id": "521a93a6-091d-4943-ba13-7c1a654a14ae",
      "companyName": "Acme Corporation",
      "companyWebsite": "https://acme.com"
    },
    "analysisId": "8f3d21ab-77c0-4c15-9b21-6b0f9c2e5d44"
  }
}

Keep analysisId — it is what Analysis Detail, Retrieve Report, and Update Analysis take.

Errors

SituationResponse
Invalid API key401 Unauthorized
Nothing analysable sent (no website, no files, no content)200 with an error envelope
Company could not be created or reused200 with "Error finding or creating project"
Analysis could not be created200 with "Unable to create a new analysis"
Last updated on