Create Company from Drive Links
Create a company from documents that live in Google Drive. Kruncher downloads each linked file with your workspace’s Drive credentials, attaches them to a new analysis, and records an external-id mapping so your own system can find the company again later.
This is the endpoint to use when your CRM or data room stores Drive links rather than file bytes. If you can send bytes, use Create Company & Upload instead.
Prerequisites
Your workspace must have Google Drive connected in Kruncher — the download runs against your stored Drive OAuth credentials. Connect it under Settings → Integrations before calling this endpoint.
Endpoint
POST https://api.kruncher.ai/api/integrationcreateandupload/projectWithGoogleDriveLinks
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Your API key (format: YOUR_API_KEY) |
Content-Type | Yes | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
companyName | string | Yes | Company name |
companyWebsite | string | Yes | Company website — also used to match an existing company |
externalId | string | Yes | The id this company has in your system |
provider | string | Yes | Your system’s name, e.g. affinity, attio, hubspot, internal |
entityType | string | No | Mapped entity type. Defaults to company |
googleDriveLinks | array or JSON string | No* | Files to download — see below |
notesText | string | No* | Free-text notes, attached as a .txt file (truncated at 10,000 characters) |
content | string | No | Raw text to analyse (requires contentType) |
contentType | string | No | The type of content, e.g. text/plain |
projectId | string (UUID) | No | Add a new analysis to this existing company instead of creating one |
* At least one of companyWebsite, googleDriveLinks, or notesText must carry content.
googleDriveLinks
An array of objects — send it as a real array or as a JSON-encoded string.
[
{ "link": "https://drive.google.com/file/d/1AbC.../view", "filename": "pitch-deck", "extension": "pdf" },
{ "link": "https://drive.google.com/file/d/2XyZ.../view", "filename": "data-room", "extension": "zip" }
]| Field | Description |
|---|---|
link | Drive file link. Entries without a non-empty link are dropped silently |
filename | Name to store the file under |
extension | File extension. zip archives are unpacked and each entry attached individually |
Limits & Behaviour
- Maximum 10 files per analysis. If the links (plus the notes file) exceed 10, notes are kept and the newest PDFs fill the remaining slots.
- Filenames are sanitised — anything outside letters, digits,
.,-,_becomes_. notesTextbecomes a file namedcompany_notes_<timestamp>_<company>.txt.- The mapping is created once. If
externalId+provider+entityTypeis already mapped, the existing mapped company is reused (itskruncherIdbecomes the target) instead of creating a duplicate — so re-sending the same record is safe.
Cost & Timing
Starts an analysis: 1 credit, typically 15–20 minutes. Drive downloads happen inline, so the request itself can take a while for large files.
Quick Start
curl -X POST "https://api.kruncher.ai/api/integrationcreateandupload/projectWithGoogleDriveLinks" \
-H "Authorization: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"companyName": "Acme Corporation",
"companyWebsite": "https://acme.com",
"externalId": "crm-4711",
"provider": "internal",
"entityType": "company",
"notesText": "Intro via Example Ventures. Raising $12M Series A.",
"googleDriveLinks": [
{
"link": "https://drive.google.com/file/d/1AbCdEfGhIjKlMnOpQrStUvWxYz/view",
"filename": "pitch-deck",
"extension": "pdf"
}
]
}'Code Examples
JavaScript/TypeScript
Basic
const API_KEY = "YOUR_API_KEY_HERE";
const BASE_URL = "https://api.kruncher.ai/api";
async function createFromDriveLinks(payload) {
const response = await fetch(
`${BASE_URL}/integrationcreateandupload/projectWithGoogleDriveLinks`,
{
method: "POST",
headers: {
"Authorization": `${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
}
);
if (!response.ok) {
throw new Error(`Request failed: ${response.statusText}`);
}
return await response.json();
}
// Usage
const result = await createFromDriveLinks({
companyName: "Acme Corporation",
companyWebsite: "https://acme.com",
externalId: "crm-4711",
provider: "internal",
googleDriveLinks: [
{
link: "https://drive.google.com/file/d/1AbCdEfGhIjKlMnOpQrStUvWxYz/view",
filename: "pitch-deck",
extension: "pdf"
}
]
});
console.log("Analysis started:", result.data);Python
import requests
API_KEY = "YOUR_API_KEY_HERE"
BASE_URL = "https://api.kruncher.ai/api"
def create_from_drive_links(
company_name: str,
company_website: str,
external_id: str,
provider: str,
drive_links: list = None,
notes: str = None,
) -> dict:
"""Create a company from Google Drive links and register an external-id mapping."""
payload = {
"companyName": company_name,
"companyWebsite": company_website,
"externalId": external_id,
"provider": provider,
"entityType": "company",
}
if drive_links:
payload["googleDriveLinks"] = drive_links
if notes:
payload["notesText"] = notes
response = requests.post(
f"{BASE_URL}/integrationcreateandupload/projectWithGoogleDriveLinks",
json=payload,
headers={
"Authorization": f"{API_KEY}",
"Content-Type": "application/json",
},
timeout=300,
)
response.raise_for_status()
body = response.json()
if body["metadata"]["code"] != "1000":
raise RuntimeError(body["metadata"]["description"])
return body["data"]
# Usage
result = create_from_drive_links(
"Acme Corporation",
"https://acme.com",
external_id="crm-4711",
provider="internal",
drive_links=[
{
"link": "https://drive.google.com/file/d/1AbCdEfGhIjKlMnOpQrStUvWxYz/view",
"filename": "pitch-deck",
"extension": "pdf",
}
],
notes="Raising $12M Series A.",
)
print(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"
}
}Errors
| Situation | Response |
|---|---|
| Invalid API key | 401 Unauthorized |
companyName or companyWebsite missing | 200 with "company Name and company Website are required." |
externalId, provider, or entityType missing | 200 with "externalId entityType, provider are required." |
| No website, links, or notes | 200 with "Either companyWebsite, googleDriveLinks, or notesText must be provided." |
| Google Drive not connected for your workspace | 200 with an error envelope from the download step |
Looking the Company Up Later
The mapping created here is readable through the mapping endpoints, so your system can go from its own id to the Kruncher company without storing the UUID:
curl -X GET "https://api.kruncher.ai/api/integration/map?entityType=company&provider=internal&externalId=crm-4711" \
-H "Authorization: YOUR_API_KEY_HERE"Related Endpoints
- Create Company & Upload — same flow with uploaded file bytes
- Lookup Mapping — resolve your external id to a Kruncher company
- Get All Mappings — every mapping in your workspace
- Company Report — read the analysis once it completes