Skip to Content
Docs are evolving — expect frequent updates.
CompanyCreate Company from Drive Links

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

HeaderRequiredDescription
AuthorizationYesYour API key (format: YOUR_API_KEY)
Content-TypeYesapplication/json

Request Body

FieldTypeRequiredDescription
companyNamestringYesCompany name
companyWebsitestringYesCompany website — also used to match an existing company
externalIdstringYesThe id this company has in your system
providerstringYesYour system’s name, e.g. affinity, attio, hubspot, internal
entityTypestringNoMapped entity type. Defaults to company
googleDriveLinksarray or JSON stringNo*Files to download — see below
notesTextstringNo*Free-text notes, attached as a .txt file (truncated at 10,000 characters)
contentstringNoRaw text to analyse (requires contentType)
contentTypestringNoThe type of content, e.g. text/plain
projectIdstring (UUID)NoAdd a new analysis to this existing company instead of creating one

* At least one of companyWebsite, googleDriveLinks, or notesText must carry content.

An array of objects — send it as a real array or as a JSON-encoded string.

CODE
[
  { "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" }
]
FieldDescription
linkDrive file link. Entries without a non-empty link are dropped silently
filenameName to store the file under
extensionFile 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 _.
  • notesText becomes a file named company_notes_<timestamp>_<company>.txt.
  • The mapping is created once. If externalId + provider + entityType is already mapped, the existing mapped company is reused (its kruncherId becomes 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

CODE
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

CODE
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

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

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"
  }
}

Errors

SituationResponse
Invalid API key401 Unauthorized
companyName or companyWebsite missing200 with "company Name and company Website are required."
externalId, provider, or entityType missing200 with "externalId entityType, provider are required."
No website, links, or notes200 with "Either companyWebsite, googleDriveLinks, or notesText must be provided."
Google Drive not connected for your workspace200 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:

CODE
curl -X GET "https://api.kruncher.ai/api/integration/map?entityType=company&provider=internal&externalId=crm-4711" \
  -H "Authorization: YOUR_API_KEY_HERE"
Last updated on