CRM API
Connect Banklyze to your CRM to keep deal data synchronized. Configure your provider credentials, define field mappings, trigger manual syncs, and receive incoming CRM webhooks for real-time updates.
Supported CRM providers: Salesforce, HubSpot, and custom REST APIs. Field mapping supports three sync directions: bidirectional, banklyze_to_crm, and crm_to_banklyze.
Get CRM Config
Returns the current CRM integration configuration, including the provider, connection status, and last sync timestamp. API credentials are not returned in the response.
curl https://api.banklyze.com/v1/crm/config \
-H "Authorization: Bearer bkz_live_abc123"{
"data": {
"provider": "salesforce",
"base_url": "https://mycompany.my.salesforce.com",
"enabled": true,
"connected_at": "2025-09-20T11:00:00Z",
"last_sync_at": "2025-11-01T06:00:00Z",
"updated_at": "2025-10-15T14:30:00Z"
}
}Set CRM Config
Creates or replaces the CRM integration configuration. Banklyze validates the connection by making a test API call to the provider before saving.
| Name | Type | Required | Description |
|---|---|---|---|
| provider | string | Required | CRM provider: salesforce, hubspot, or custom |
| api_key | string | Required | API key or personal access token for the CRM |
| base_url | string | Required | Base URL of the CRM instance |
| enabled | boolean | Default: true | Whether syncing is enabled |
curl -X PUT https://api.banklyze.com/v1/crm/config \
-H "Authorization: Bearer bkz_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"provider": "salesforce",
"api_key": "sf_pat_01JDKF9X2M3N4P5Q6R7S8T9U",
"base_url": "https://mycompany.my.salesforce.com",
"enabled": true
}'{
"data": {
"provider": "salesforce",
"base_url": "https://mycompany.my.salesforce.com",
"enabled": true,
"connected_at": "2025-11-01T14:30:00Z",
"last_sync_at": null,
"updated_at": "2025-11-01T14:30:00Z"
}
}List Field Mappings
Returns all configured field mappings between Banklyze deal fields and CRM object fields. Each mapping specifies the sync direction.
curl https://api.banklyze.com/v1/crm/field-mappings \
-H "Authorization: Bearer bkz_live_abc123"{
"data": [
{
"banklyze_field": "business_name",
"crm_field": "Account.Name",
"direction": "bidirectional"
},
{
"banklyze_field": "health_score",
"crm_field": "Opportunity.Health_Score__c",
"direction": "banklyze_to_crm"
},
{
"banklyze_field": "decision",
"crm_field": "Opportunity.Underwriting_Decision__c",
"direction": "banklyze_to_crm"
},
{
"banklyze_field": "funding_amount_requested",
"crm_field": "Opportunity.Amount",
"direction": "crm_to_banklyze"
},
{
"banklyze_field": "external_reference",
"crm_field": "Opportunity.Id",
"direction": "crm_to_banklyze"
}
]
}Set Field Mappings
Replaces all field mappings with the provided array. Each mapping defines a Banklyze field, a CRM field, and the sync direction.
| Name | Type | Required | Description |
|---|---|---|---|
| banklyze_field | string | Required | Banklyze deal field name |
| crm_field | string | Required | CRM object and field (e.g. Account.Name) |
| direction | string | Required | Sync direction: bidirectional, banklyze_to_crm, or crm_to_banklyze |
curl -X PUT https://api.banklyze.com/v1/crm/field-mappings \
-H "Authorization: Bearer bkz_live_abc123" \
-H "Content-Type: application/json" \
-d '[
{
"banklyze_field": "business_name",
"crm_field": "Account.Name",
"direction": "bidirectional"
},
{
"banklyze_field": "health_score",
"crm_field": "Opportunity.Health_Score__c",
"direction": "banklyze_to_crm"
},
{
"banklyze_field": "decision",
"crm_field": "Opportunity.Underwriting_Decision__c",
"direction": "banklyze_to_crm"
},
{
"banklyze_field": "funding_amount_requested",
"crm_field": "Opportunity.Amount",
"direction": "crm_to_banklyze"
}
]'{
"data": [
{
"banklyze_field": "business_name",
"crm_field": "Account.Name",
"direction": "bidirectional"
},
{
"banklyze_field": "health_score",
"crm_field": "Opportunity.Health_Score__c",
"direction": "banklyze_to_crm"
},
{
"banklyze_field": "decision",
"crm_field": "Opportunity.Underwriting_Decision__c",
"direction": "banklyze_to_crm"
},
{
"banklyze_field": "funding_amount_requested",
"crm_field": "Opportunity.Amount",
"direction": "crm_to_banklyze"
}
]
}Trigger Sync
Initiates a manual bidirectional sync between Banklyze and the configured CRM. The sync runs asynchronously in the background. Use the sync logs endpoint to track progress.
curl -X POST https://api.banklyze.com/v1/crm/sync \
-H "Authorization: Bearer bkz_live_abc123"{
"data": {
"sync_id": "sync_01JE8L9Y3N4O5P6Q7R8S",
"status": "running",
"started_at": "2025-11-01T14:30:00Z",
"direction": "bidirectional",
"records_queued": 47
}
}List Sync Logs
Returns a paginated list of sync runs with status, record counts, and timing information. Filter by status to find failed syncs.
| Name | Type | Required | Description |
|---|---|---|---|
| page | integer | Default: 1 | Page number |
| per_page | integer | Default: 25 | Results per page (1-100) |
| status | string | Optional | Filter by status: running, completed, failed |
curl "https://api.banklyze.com/v1/crm/sync/logs?page=1&per_page=10&status=completed" \
-H "Authorization: Bearer bkz_live_abc123"{
"data": [
{
"id": "sync_01JE8L9Y3N4O5P6Q7R8S",
"status": "completed",
"direction": "bidirectional",
"records_synced": 47,
"records_failed": 0,
"started_at": "2025-11-01T14:30:00Z",
"completed_at": "2025-11-01T14:30:12Z",
"duration_ms": 12340
},
{
"id": "sync_01JE7K8X2M3N4P5Q6R7S",
"status": "completed",
"direction": "bidirectional",
"records_synced": 23,
"records_failed": 1,
"started_at": "2025-11-01T06:00:00Z",
"completed_at": "2025-11-01T06:00:08Z",
"duration_ms": 8120
}
],
"meta": {
"page": 1,
"per_page": 10,
"total": 2,
"total_pages": 1
}
}Sync Log Detail
Returns detailed results of a specific sync run, including per-direction record counts and individual error details for any failed records.
| Name | Type | Required | Description |
|---|---|---|---|
| log_id | string | Required | The sync log ID |
curl https://api.banklyze.com/v1/crm/sync/logs/sync_01JE7K8X2M3N4P5Q6R7S \
-H "Authorization: Bearer bkz_live_abc123"{
"data": {
"id": "sync_01JE7K8X2M3N4P5Q6R7S",
"status": "completed",
"direction": "bidirectional",
"records_synced": 23,
"records_failed": 1,
"started_at": "2025-11-01T06:00:00Z",
"completed_at": "2025-11-01T06:00:08Z",
"duration_ms": 8120,
"details": {
"created_in_crm": 5,
"updated_in_crm": 12,
"created_in_banklyze": 2,
"updated_in_banklyze": 4,
"skipped": 0,
"errors": [
{
"record_id": "opp_8821",
"field": "Health_Score__c",
"error": "Field is read-only in Salesforce",
"direction": "banklyze_to_crm"
}
]
}
}
}Handle CRM Webhook
Receives incoming webhooks from the CRM provider. When a CRM record is created or updated, this endpoint maps the changed fields to the corresponding Banklyze deal and triggers a partial sync.
| Name | Type | Required | Description |
|---|---|---|---|
| provider | string | Required | CRM provider identifier |
| event | string | Required | CRM event type (e.g. opportunity.updated) |
| record_id | string | Required | CRM record ID that changed |
| fields | object | Required | Changed field values from the CRM |
| timestamp | string | Required | ISO 8601 timestamp of the CRM event |
curl -X POST https://api.banklyze.com/v1/crm/webhooks \
-H "Authorization: Bearer bkz_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"provider": "salesforce",
"event": "opportunity.updated",
"record_id": "006Hs00001abcDEF",
"fields": {
"Amount": 150000,
"StageName": "Underwriting",
"Account_Name": "Acme Trucking LLC"
},
"timestamp": "2025-11-01T14:35:00Z"
}'{
"data": {
"received": true,
"deal_id": 42,
"action": "updated",
"fields_mapped": 2,
"sync_id": "sync_01JE8M0Z4O5P6Q7R8S9T"
}
}