CRM Integration
Banklyze can sync deal data bi-directionally with your CRM. Supported providers are Salesforce, HubSpot, and Pipedrive. Each provider is configured independently per organization — you can run multiple integrations simultaneously.
Configuration follows a three-step flow: (1) save credentials via PUT /crm/config/{provider}, (2) verify the connection with POST /crm/config/{provider}/test, and (3) define field mappings with PUT /crm/field-mapping/{provider}. Once configured, Banklyze syncs deal data on a schedule and after key deal events. Manual syncs are available via POST /crm/sync.
Retrieve the current CRM configuration for a provider. The has_credentials flag indicates whether credentials are stored — the credential values themselves are never returned.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| provider | string | Required | The CRM provider: salesforce, hubspot, or pipedrive |
Example
curl -X GET https://api.banklyze.com/v1/crm/config/hubspot \
-H "X-API-Key: your_api_key_here"Response
{
"provider": "hubspot",
"enabled": true,
"has_credentials": true,
"sync_interval_minutes": 60,
"last_sync_at": "2026-03-04T10:00:00Z",
"last_sync_status": "success"
}Upsert the CRM configuration for a provider. If a configuration already exists it is replaced. Credentials are encrypted at rest and never returned in subsequent GET responses. After saving credentials, call POST /crm/config/{provider}/test to verify the connection before enabling the integration.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| provider | string | Required | The CRM provider: salesforce, hubspot, or pipedrive |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| enabled | boolean | Default: true | Whether the integration is active. Disabled integrations will not sync. |
| credentials | object | Optional | Provider-specific credentials object. For HubSpot: { access_token }. For Salesforce: { client_id, client_secret, refresh_token, instance_url }. For Pipedrive: { api_token }. |
| sync_interval_minutes | integer | Default: 60 | How often to sync, in minutes. Minimum 15, maximum 1440 (24 hours). |
Example
curl -X PUT https://api.banklyze.com/v1/crm/config/hubspot \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"credentials": {
"access_token": "pat-na1-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
},
"sync_interval_minutes": 60
}'Response
{
"provider": "hubspot",
"enabled": true,
"has_credentials": true,
"sync_interval_minutes": 60,
"last_sync_at": null,
"last_sync_status": null
}Remove the CRM configuration and stored credentials for a provider. Any scheduled syncs for this provider will stop. Field mappings are also deleted. This action is irreversible.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| provider | string | Required | The CRM provider: salesforce, hubspot, or pipedrive |
Example
curl -X DELETE https://api.banklyze.com/v1/crm/config/hubspot \
-H "X-API-Key: your_api_key_here"Response
{
"status": "ok",
"message": "CRM configuration removed"
}Verify that the stored credentials for a provider are valid and the connection can be established. Returns a human-readable message with authentication details on success, or an error description on failure. Does not modify any configuration.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| provider | string | Required | The CRM provider: salesforce, hubspot, or pipedrive |
Example
curl -X POST https://api.banklyze.com/v1/crm/config/hubspot/test \
-H "X-API-Key: your_api_key_here"Response
{
"success": true,
"message": "Connection to HubSpot verified. Authenticated as Acme Lending (account ID 12345678)."
}Field Mappings
Field mappings define which Banklyze deal fields map to which CRM fields, and in which direction data flows. The direction value can be to_crm (Banklyze writes to CRM only), from_crm (CRM writes to Banklyze only), or both (bi-directional sync, last-write-wins).
Retrieve all configured field mappings for a provider. Returns an empty mappings array if no mappings have been configured yet.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| provider | string | Required | The CRM provider: salesforce, hubspot, or pipedrive |
Example
curl -X GET https://api.banklyze.com/v1/crm/field-mapping/hubspot \
-H "X-API-Key: your_api_key_here"Response
{
"provider": "hubspot",
"mappings": [
{
"banklyze_field": "business_name",
"crm_field": "dealname",
"direction": "both"
},
{
"banklyze_field": "funding_amount_requested",
"crm_field": "amount",
"direction": "to_crm"
},
{
"banklyze_field": "health_score",
"crm_field": "banklyze_health_score__c",
"direction": "to_crm"
},
{
"banklyze_field": "health_grade",
"crm_field": "banklyze_grade__c",
"direction": "to_crm"
},
{
"banklyze_field": "owner_name",
"crm_field": "contact_firstname",
"direction": "from_crm"
}
]
}Replace all field mappings for a provider. The entire mapping set is overwritten — any mappings not included in the request body are deleted. Send an empty mappings array to clear all mappings.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| provider | string | Required | The CRM provider: salesforce, hubspot, or pipedrive |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| mappings | object[] | Required | Array of mapping objects. Each object has: banklyze_field (string), crm_field (string), direction (to_crm | from_crm | both). |
Example
curl -X PUT https://api.banklyze.com/v1/crm/field-mapping/hubspot \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"mappings": [
{
"banklyze_field": "business_name",
"crm_field": "dealname",
"direction": "both"
},
{
"banklyze_field": "health_score",
"crm_field": "banklyze_health_score__c",
"direction": "to_crm"
}
]
}'Response
{
"provider": "hubspot",
"mappings": [
{
"banklyze_field": "business_name",
"crm_field": "dealname",
"direction": "both"
},
{
"banklyze_field": "health_score",
"crm_field": "banklyze_health_score__c",
"direction": "to_crm"
}
]
}Sync
Banklyze runs scheduled syncs automatically based on sync_interval_minutes. Syncs are also triggered after key deal events: when a deal reaches ready status, when a decision is set, or when a recommendation is generated. Use the manual sync endpoint to push changes immediately without waiting for the next scheduled interval.
Push a single deal to all enabled CRM integrations immediately. The sync runs synchronously and returns the result. If multiple CRM providers are configured, all are synced and results are aggregated.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| deal_id | integer | Required | The deal to sync to the CRM |
Example
curl -X POST https://api.banklyze.com/v1/crm/sync \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"deal_id": 42
}'Response
{
"status": "success",
"external_id": "0065g00000AbCdEFAZ",
"error": null
}Retrieve the history of CRM sync attempts for your organization. Filter by deal to see all sync events for a specific deal. Both successful syncs and errors are recorded. Sync log entries are retained for 90 days.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| deal_id | integer | Optional | Filter sync events by deal ID |
| provider | string | Optional | Filter by provider: salesforce, hubspot, or pipedrive |
| status | string | Optional | Filter by sync status: success or error |
| page | integer | Default: 1 | Page number |
| per_page | integer | Default: 25 | Results per page (max 100) |
Example
curl -X GET "https://api.banklyze.com/v1/crm/sync-log?deal_id=42&page=1&per_page=25" \
-H "X-API-Key: your_api_key_here"Response
{
"data": [
{
"id": 18,
"deal_id": 42,
"provider": "hubspot",
"direction": "to_crm",
"status": "success",
"external_id": "0065g00000AbCdEFAZ",
"error": null,
"synced_at": "2026-03-04T11:05:00Z"
},
{
"id": 12,
"deal_id": 42,
"provider": "hubspot",
"direction": "to_crm",
"status": "error",
"external_id": null,
"error": "Property 'banklyze_health_score__c' does not exist on Deal objects.",
"synced_at": "2026-03-04T10:00:00Z"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 2,
"total_pages": 1
}
}