Skip to Content
Docs are evolving — expect frequent updates.
Company ReportUpdate Analysis

Update Analysis

Update specific entity values within an existing analysis. Use this endpoint to refine analysis data, correct information, or add missing details.

Endpoint

PUT https://api.kruncher.ai/api/integration/analysis/detail

Headers

HeaderRequiredDescription
AuthorizationYesYour API key (format: YOUR_API_KEY)
Content-TypeYesMust be application/json

Request Body

FieldTypeRequiredDescription
analysisIdstringYesThe ID of the analysis to update
entityKeystringYesThe entity field name to update (e.g., email, revenue, stage)
valueanyYesThe new value for the entity (type depends on entity)

Common Entity Keys

Entity KeyValue TypeExampleDescription
emailstring"contact@company.com"Company contact email
revenuenumber5000000Annual revenue in USD
stagestring"seriesA"Company stage
industryarray["Software", "SaaS"]Industry classifications
employeesnumber50Employee count
websitestring"https://company.com"Company website
descriptionstring"AI-powered analytics"Company description
fundingRaisednumber10000000Total funding raised
valuationnumber50000000Company valuation

Code Examples

JavaScript/TypeScript

CODE
const API_KEY = "YOUR_API_KEY_HERE";
 
const response = await fetch("https://api.kruncher.ai/api/integration/analysis/detail", {
  method: "PUT",
  headers: {
    "Authorization": `${API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    analysisId: "analysis_123",
    entityKey: "email",
    value: "contact@techstartup.com"
  })
});
 
const result = await response.json();
console.log("Update result:", result);

Result: Updates the email entity for the specified analysis.

Python

CODE
import requests
 
API_KEY = "YOUR_API_KEY_HERE"
url = "https://api.kruncher.ai/api/integration/analysis/detail"
 
headers = {
    "Authorization": f"{API_KEY}",
    "Content-Type": "application/json"
}
 
data = {
    "analysisId": "analysis_123",
    "entityKey": "email",
    "value": "contact@techstartup.com"
}
 
response = requests.put(url, headers=headers, json=data)
 
if response.status_code == 200:
    print("Update successful:", response.json())
else:
    print(f"Error: {response.status_code} {response.text}")

Result: Updates a single entity value.

cURL

CODE
curl -X PUT "https://api.kruncher.ai/api/integration/analysis/detail" \
  -H "Authorization: YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "analysisId": "analysis_123",
    "entityKey": "email",
    "value": "contact@techstartup.com"
  }'

Response

Success Response (200 OK)

CODE
{
  "code": "1000",
  "title": "Success",
  "description": "Entity updated successfully",
  "data": {
    "analysisId": "analysis_123",
    "entityKey": "email",
    "value": "contact@techstartup.com",
    "updatedAt": "2024-01-15T10:30:00Z"
  }
}

Error Responses

400 Bad Request

CODE
{
  "code": "4000",
  "title": "Bad Request",
  "description": "Invalid entity key or value"
}

404 Not Found

CODE
{
  "code": "4040",
  "title": "Not Found",
  "description": "Analysis not found"
}

401 Unauthorized

CODE
{
  "code": "4010",
  "title": "Unauthorized",
  "description": "Invalid or missing API key"
}

Common Entity Updates

Update Contact Information

CODE
// Update email
await api.updateEntity("analysis_123", "email", "contact@company.com");
 
// Update website
await api.updateEntity("analysis_123", "website", "https://company.com");

Update Financial Data

CODE
// Update revenue
await api.updateEntity("analysis_123", "revenue", 5000000);
 
// Update funding raised
await api.updateEntity("analysis_123", "fundingRaised", 10000000);
 
// Update valuation
await api.updateEntity("analysis_123", "valuation", 50000000);

Update Company Details

CODE
// Update stage
await api.updateEntity("analysis_123", "stage", "seriesA");
 
// Update employee count
await api.updateEntity("analysis_123", "employees", 50);
 
// Update industry
await api.updateEntity("analysis_123", "industry", ["Software", "SaaS"]);

Validation Rules

Email

  • Must be valid email format
  • Example: contact@company.com

Revenue, Funding, Valuation

  • Must be non-negative numbers
  • Specified in USD
  • Example: 5000000 (for $5M)

Website

  • Must be valid URL with protocol
  • Example: https://company.com

Stage

  • Must match valid stages: preSeed, seed, seriesA, seriesB, seriesC, growth, ipo

Industry

  • Can be string or array of strings
  • Example: ["Software", "SaaS", "B2B"]

Employees

  • Must be non-negative integer
  • Example: 50

Best Practices

Data Validation

  • Always validate data before sending
  • Check for correct data types
  • Ensure values are within expected ranges

Error Handling

  • Wrap updates in try-catch blocks
  • Log failed updates for review
  • Consider retry logic for transient failures

Batch Updates

  • When updating multiple entities, process sequentially
  • Track successful and failed updates
  • Don’t stop on first error unless critical

Performance

  • Batch related updates together
  • Avoid unnecessary updates (check if value changed)
  • Use appropriate rate limiting

Example Workflows

Workflow 1: Update After Data Collection

CODE
# After collecting data from a company
company_data = collect_company_data()  # Your data collection function
 
# Update analysis with new data
api = KruncherAnalysisAPI()
results = api.update_from_dict("analysis_123", {
    "email": company_data["contact_email"],
    "revenue": company_data["annual_revenue"],
    "employees": company_data["team_size"],
    "fundingRaised": company_data["total_funding"]
})
 
# Check results
summary = api.get_update_summary(results)
if summary['failed'] > 0:
    print(f"Warning: {summary['failed']} updates failed")

Workflow 2: Correct Analysis Data

CODE
// Fix incorrect data in analysis
const corrections = [
  { entityKey: "email", value: "correct@email.com" },
  { entityKey: "revenue", value: 7500000 },  // Corrected from 5M to 7.5M
  { entityKey: "stage", value: "seriesB" }    // Updated from seriesA
];
 
const api = new KruncherAnalysisAPI(API_KEY);
const results = await api.updateMultiple("analysis_123", corrections);
 
console.log(`Corrected ${results.successful.length} fields`);

Workflow 3: Enrich Analysis

CODE
# Enrich analysis with additional data
enrichment_data = {
    "website": "https://techstartup.com",
    "description": "AI-powered analytics platform for investors",
    "industry": ["Software", "SaaS", "FinTech"],
    "valuation": 75000000
}
 
api = KruncherAnalysisAPI()
results = api.update_from_dict("analysis_123", enrichment_data, validate=True)
 
print(f"Enriched analysis with {len(results)} fields")

Troubleshooting

Update Not Reflecting

  • Check that you’re using the correct analysisId
  • Verify the entityKey is spelled correctly
  • Ensure the value type matches the entity requirements

Validation Errors

  • Check value format (especially for email, website)
  • Ensure numbers are positive where required
  • Verify stage/status values match accepted values

Performance Issues

  • Reduce batch size if updates are timing out
  • Add delays between updates if rate limited
  • Consider updating only changed values

Need Help?

  • Unknown entity keys? Check the Data Model documentation
  • Validation failing? Review the validation rules above
  • Bulk updates? Contact support for batch update options
Last updated on