Skip to main content
POST
/
api
/
v1
/
operations
/
crm
/
test-connection
curl -X POST "https://app.lance.so/api/v1/operations/crm/test-connection" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "close",
    "apiKey": "api_xxxxxxxxxxxxxxxxxxxxxxxx"
  }'
{
  "success": true
}
This endpoint tests the connection to a CRM provider (Close or Bullhorn) using the provided API key. Use this to validate credentials before saving CRM settings or to verify that existing credentials are still working.

Authentication

This endpoint requires authentication. The request must include a valid session with an associated organization.

Request

Body Parameters

provider
string
required
The CRM provider to connect to. Allowed values: close, bullhorn
apiKey
string
required
The API key for authenticating with the CRM provider. Must be at least 1 character. - For Close: Use your Close API key from Settings > API Keys - For Bullhorn: Use your Bullhorn REST API credentials

Response

success
boolean
required
Indicates whether the connection test was successful. - true: The API key is valid and connection was established - false: The connection failed (see error field for details)
error
string
Error message describing why the connection test failed. Only present when success is false. Common errors include: - Invalid API key - Network connectivity issues - CRM service unavailable
curl -X POST "https://app.lance.so/api/v1/operations/crm/test-connection" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "close",
    "apiKey": "api_xxxxxxxxxxxxxxxxxxxxxxxx"
  }'
{
  "success": true
}

Error Codes

Status CodeError CodeDescription
400VALIDATION_ERRORMissing or invalid request parameters (provider or apiKey)
401VALIDATION_ERRORUser is not authenticated or not associated with an organization
500INTERNAL_ERRORServer error during connection test

Supported CRM Providers

Close CRM

  • Provider value: close
  • API Key format: Starts with api_ followed by alphanumeric characters
  • Documentation: Close API Documentation

Bullhorn CRM

  • Provider value: bullhorn
  • API Key format: REST API credentials from Bullhorn
  • Documentation: Bullhorn REST API

Notes

  • This endpoint only tests the connection; it does not save credentials
  • To save CRM settings after a successful test, use the CRM settings endpoint
  • The connection test verifies API key validity by making a lightweight request to the CRM provider
  • Rate limiting may apply based on your CRM provider’s API limits