Get All Mappings
Retrieve all entity mappings for your account, showing connections between Kruncher entities (person, company, opportunity) and external provider IDs. Use this to audit integrations, verify sync status, and manage cross-platform relationships.
Endpoint
GET https://api.kruncher.ai/api/integration/map/all
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Your API key (format: YOUR_API_KEY) |
Content-Type | No | Optional application/json |
Query Parameters
This endpoint currently returns all mappings without pagination.
Use Cases
When to Use This Endpoint
- Audit Integrations: Review all active mappings across providers
- Verify Sync: Check which entities are mapped to external systems
- Troubleshooting: Debug integration issues by viewing all mappings
- Migration Validation: Confirm migration mappings were created correctly
- Integration Cleanup: Identify and remove outdated mappings
- Multi-Provider Management: See all provider connections at once
Code Examples
JavaScript/TypeScript
Basic
const API_KEY = "YOUR_API_KEY_HERE";
const response = await fetch("https://api.kruncher.ai/api/integration/map/all", {
headers: {
"Authorization": `${API_KEY}`,
"Content-Type": "application/json"
}
});
const result = await response.json();
console.log(`Total mappings: ${result.data.length}`);
console.log("Mappings:", result.data);Result: Retrieves all mappings for your account.
Python
Basic
import requests
API_KEY = "YOUR_API_KEY_HERE"
url = "https://api.kruncher.ai/api/integration/map/all"
headers = {
"Authorization": f"{API_KEY}",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
result = response.json()
print(f"Total mappings: {len(result['data'])}")
print(f"Mappings: {result['data']}")
else:
print(f"Error: {response.status_code} {response.text}")Result: Retrieves all mappings for your account.
cURL
Basic
curl -X GET "https://api.kruncher.ai/api/integration/map/all" \
-H "Authorization: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json"Response Structure
Success Response (200 OK)
{
"code": "1000",
"title": "Successful",
"description": "",
"data": [
{
"id": "mapping_abc123",
"entityType": "company",
"provider": "affinity",
"kruncherId": "proj_123",
"externalId": "affinity_org_456",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"customerId": "customer_xyz789"
},
{
"id": "mapping_def456",
"entityType": "person",
"provider": "attio",
"kruncherId": "person_abc",
"externalId": "attio_contact_123",
"createdAt": "2024-01-16T14:20:00Z",
"updatedAt": "2024-01-16T14:20:00Z",
"customerId": "customer_xyz789"
},
{
"id": "mapping_ghi789",
"entityType": "opportunity",
"provider": "pipedrive",
"kruncherId": "opp_def",
"externalId": "pipedrive_deal_789",
"createdAt": "2024-01-17T09:15:00Z",
"updatedAt": "2024-01-17T09:15:00Z",
"customerId": "customer_xyz789"
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique mapping identifier |
entityType | string | Type: person, company, or opportunity |
provider | string | External provider name |
kruncherId | string | Kruncher internal ID |
externalId | string | External system ID |
createdAt | string | ISO 8601 timestamp when created |
updatedAt | string | ISO 8601 timestamp when last updated |
customerId | string | Your customer ID |
Common Use Cases
Audit All Integrations
const reader = new KruncherMappingReader(API_KEY);
const stats = await reader.getMappingStats();
console.log(`Total mappings: ${stats.total}`);
console.log(`Active providers: ${stats.providers_count}`);
console.log("\nBreakdown by provider:");
for (const [provider, count] of Object.entries(stats.byProvider)) {
console.log(` ${provider}: ${count} mappings`);
}Find Unmapped Companies
reader = KruncherMappingReader()
# Get all Kruncher companies
all_companies = get_kruncher_companies()
# Find companies not mapped to Affinity
unmapped = reader.find_unmapped_entities(all_companies, "affinity")
print(f"Found {len(unmapped)} companies not synced to Affinity:")
for company in unmapped:
print(f" - {company['name']} (ID: {company['id']})")Validate External IDs
// Check if all mapped external IDs still exist in Affinity
async function validateAffinityMappings() {
const reader = new KruncherMappingReader(API_KEY);
const affinityMappings = await reader.getMappingsByProvider("affinity");
const invalid = [];
for (const mapping of affinityMappings) {
const exists = await checkAffinityOrgExists(mapping.externalId);
if (!exists) {
invalid.push(mapping);
}
}
if (invalid.length > 0) {
console.log(`Found ${invalid.length} invalid mappings:`);
invalid.forEach(m => console.log(` - ${m.kruncherId} → ${m.externalId}`));
} else {
console.log("All mappings valid!");
}
}Export for Backup
# Export all mappings for backup
reader = KruncherMappingReader()
# Export to CSV
reader.export_to_csv('backups/mappings_2024-01-15.csv')
# Export to JSON
reader.export_to_json('backups/mappings_2024-01-15.json')
print("Backup complete!")Lookup External ID
// Quick lookup of external ID for syncing
const reader = new KruncherMappingReader(API_KEY);
const kruncherId = "proj_123";
const affinityId = await reader.getExternalId(kruncherId, "affinity");
if (affinityId) {
// Sync data to Affinity using their ID
await updateAffinityOrganization(affinityId, companyData);
} else {
console.log("No Affinity mapping found for this company");
}Best Practices
Caching
- Cache mappings locally for 5-15 minutes
- Refresh cache after creating new mappings
- Use force refresh sparingly
- Share cache across application
Validation
- Periodically validate external IDs still exist
- Check for orphaned mappings
- Monitor mapping creation vs deletion rates
- Alert on validation failures
Performance
- Don’t fetch on every request
- Filter locally after fetching once
- Use indexed lookups for large datasets
- Consider pagination for very large result sets
Data Integrity
- Export mappings regularly for backup
- Verify mapping counts match expectations
- Monitor for duplicate mappings
- Track mapping age and staleness
Related Endpoints
- Create Mapping - Create new entity mappings
- Delete Mapping - Remove mappings (contact support)
- Find Companies - Get Kruncher entity IDs
- Integrations - Provider-specific guides
Troubleshooting
No Mappings Returned
- Verify API key is correct
- Check if any mappings have been created
- Ensure you’re using correct endpoint
- Try creating a test mapping
Missing Mappings
- Check if mappings were created successfully
- Verify correct customer account
- Look for deletion logs
- Contact support for recovery
Duplicate Entries
- Same Kruncher ID with multiple external IDs for one provider
- Contact support to resolve duplicates
- Review mapping creation logic
Performance Issues
- Large number of mappings (>10,000)
- Implement local caching
- Filter on server side if available
- Contact support for pagination options
Need Help?
- Large export? Contact support for bulk export options
- Delete mappings? Request mapping cleanup assistance
- Custom queries? Ask about filtering options
- Migration? Get help with bulk mapping management
Last updated on