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 Company → Upload 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
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Your API key (format: YOUR_API_KEY) |
Content-Type | Yes | multipart/form-data — set automatically by your HTTP client |
Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
companyName | text | Yes | Company name |
companyWebsite | text | Yes* | Company website. Used to match an existing company; also the analysis source when no files are sent |
files | file | No | One or more documents. Repeat the field for multiple files |
content | text | No | Raw text to analyse alongside the files (requires contentType) |
contentType | text | No | The type of content, e.g. text/plain, text/html |
projectId | text | No | Add 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 send | Result |
|---|---|
projectId | That company is reused, and a new analysis is added to it |
No projectId, website matches an existing company | The existing company is reused, and a new analysis is added |
No projectId, website is new | A 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
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
Basic
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
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)
{
"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
| Situation | Response |
|---|---|
| Invalid API key | 401 Unauthorized |
| Nothing analysable sent (no website, no files, no content) | 200 with an error envelope |
| Company could not be created or reused | 200 with "Error finding or creating project" |
| Analysis could not be created | 200 with "Unable to create a new analysis" |
Related Endpoints
- Create Company from Drive Links — same flow, files pulled from Google Drive
- Create Company — create without attaching files
- Upload Files — attach files to an existing analysis
- Create Company from HTML — create from an HTML document