Assign Company to List
Add companies to or remove them from project lists. Use this to organize your portfolio by industry, stage, geography, or custom categories.
Endpoint
POST https://api.kruncher.ai/api/integration/projectlist/assign
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Your API key (format: YOUR_API_KEY) |
Content-Type | Yes | Must be application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Unique project/company identifier |
projectlistId | string | Yes | Unique list identifier |
addTrueRemoveFalse | boolean | Yes | true to add, false to remove |
How to Get IDs
Project ID:
- Get from Find Companies endpoint
- Returned when Creating a Company
List ID:
- Get from Project Lists endpoint
- Available in your organization’s list configuration
Use Cases
When to Assign Companies
- Portfolio Organization: Group companies by stage, industry, or geography
- Team Assignment: Create lists for different team members
- Investment Stages: Organize by funding round or status
- Geographic Focus: Group by region or country
- Market Segments: Segment by vertical or market
- Bulk Operations: Organize multiple companies at once
- Dynamic Updates: Update list membership as deals progress
Code Examples
JavaScript/TypeScript
Single Assignment
const API_KEY = "YOUR_API_KEY_HERE";
// Add company to list
const response = await fetch("https://api.kruncher.ai/api/integration/projectlist/assign", {
method: "POST",
headers: {
"Authorization": `${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
projectId: "proj_123",
projectlistId: "list_tech_startups",
addTrueRemoveFalse: true
})
});
const result = await response.json();
console.log("Company added to list:", result);
// Remove company from list
const removeResponse = await fetch("https://api.kruncher.ai/api/integration/projectlist/assign", {
method: "POST",
headers: {
"Authorization": `${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
projectId: "proj_123",
projectlistId: "list_tech_startups",
addTrueRemoveFalse: false
})
});
console.log("Company removed from list:", await removeResponse.json());Result: Adds or removes a company from a list.
Python
Single Assignment
import requests
API_KEY = "YOUR_API_KEY_HERE"
url = "https://api.kruncher.ai/api/integration/projectlist/assign"
headers = {
"Authorization": f"{API_KEY}",
"Content-Type": "application/json"
}
# Add company to list
data = {
"projectId": "proj_123",
"projectlistId": "list_tech_startups",
"addTrueRemoveFalse": True
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
print("Company added:", response.json())
else:
print(f"Error: {response.status_code} {response.text}")
# Remove company from list
data["addTrueRemoveFalse"] = False
response = requests.post(url, headers=headers, json=data)
print("Company removed:", response.json())Result: Add or remove company from a list.
cURL
Add Company
curl -X POST "https://api.kruncher.ai/api/integration/projectlist/assign" \
-H "Authorization: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"projectId": "proj_123",
"projectlistId": "list_tech_startups",
"addTrueRemoveFalse": true
}'Response
Success Response (200 OK)
{
"code": "1000",
"title": "Success",
"description": "Company assignment successful",
"data": {
"projectId": "proj_123",
"projectlistId": "list_tech_startups",
"action": "added",
"timestamp": "2024-01-15T10:30:00Z"
}
}Error Responses
400 Bad Request
{
"code": "4000",
"title": "Bad Request",
"description": "Invalid project ID or list ID"
}404 Not Found
{
"code": "4040",
"title": "Not Found",
"description": "Project or list not found"
}409 Conflict
{
"code": "4090",
"title": "Conflict",
"description": "Company is already in this list"
}Common Workflows
Workflow 1: Organize New Company
// When creating a new company, assign it to appropriate lists
const projectId = "newly_created_project";
const manager = new ProjectListAssignmentManager(API_KEY);
// Add to industry list
await manager.addToList(projectId, "list_technology");
// Add to stage list
await manager.addToList(projectId, "list_seed_stage");
// Add to geographic list
await manager.addToList(projectId, "list_us_west");
console.log("Company organized into all lists");Workflow 2: Bulk Portfolio Organization
manager = ProjectListAssignmentManager()
# Get all companies (from retrieve endpoint)
companies = get_all_companies()
# Organize companies by stage
for company in companies:
stage = company['stage']
if stage == 'seed':
manager.add_to_list(company['id'], 'list_seed')
elif stage == 'seriesA':
manager.add_to_list(company['id'], 'list_seriesA')
elif stage == 'seriesB':
manager.add_to_list(company['id'], 'list_seriesB')
print("Portfolio organized by stage")Workflow 3: Move Companies Between Lists
// When a company moves from seed to Series A
const manager = new ProjectListAssignmentManager(API_KEY);
const results = await manager.moveCompaniesToList(
["proj_1", "proj_2"],
"list_seed",
"list_seriesA"
);
console.log(`Promoted ${results.successful.length} companies to Series A`);Workflow 4: Clean Up Old Lists
manager = ProjectListAssignmentManager()
# Remove all companies from old list
old_companies = get_companies_in_list("list_2023_rejected")
results = manager.bulk_remove(
[c['id'] for c in old_companies],
"list_2023_rejected"
)
print(f"Removed {len(results['successful'])} companies from old list")Best Practices
Before Assigning
- Verify project exists
- Verify list exists
- Check project isn’t already in list (avoid duplicates)
- Log assignment operations
- Track assignment history
Bulk Operations
- Use batch processing for large datasets
- Add delays between batches (100-200ms)
- Track failed assignments
- Retry failed assignments
- Log all operations
List Management
- Keep lists organized and named clearly
- Archive old lists instead of deleting
- Document list purposes and owners
- Review list membership periodically
- Remove inactive companies
Error Handling
try {
await manager.addToList(projectId, listId);
} catch (error) {
if (error.message.includes("already")) {
// Company already in list
console.log("Already assigned");
} else if (error.message.includes("not found")) {
// Project or list not found
console.log("Invalid project or list ID");
} else {
// Other error
console.error("Assignment failed:", error);
}
}Related Endpoints
- Project Lists - Get available lists
- Find Companies - Get project IDs
- Create Company - Create new projects
- Update Project Status - Track progress
Troubleshooting
Company Already in List
- Check current list membership before adding
- Remove first, then re-add if needed
- Verify you want to add to this list
Invalid Project or List ID
- Get correct IDs from Project Lists
- Get correct IDs from Find Companies
- Verify IDs are not swapped
Bulk Assignment Failing
- Check batch size (10-50 recommended)
- Add delays between batches
- Check for rate limiting
- Retry failed assignments
Assignment Not Persisting
- Verify response indicates success
- Check assignment immediately after
- Confirm you have proper permissions
- Contact support if issue persists
Need Help?
- List not found? See Project Lists to get list IDs
- Bulk operations? Use batch processing with delays
- Moving companies? Use reorganize methods for safe transfers
- Performance issues? Implement caching and batching
Last updated on