RedPlanetHQ/core

New Integration: Close CRM

開放

#518 建立於 2026年2月24日

 (0 則留言) (0 個反應) (0 位負責人)TypeScript (184 個分叉)auto 404
enhancementgood first issueintegrationnew-featurenew-integration

倉庫指標

星標
 (1,930 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Description

Add Close CRM integration to sync leads, contacts, opportunities, activities (calls, emails, notes), and sales pipeline data into CORE.

Reference Implementations

Existing Integrations (use as templates)

  • integrations/hubspot/ - Similar CRM system
  • integrations/linear/ - Project management integration
  • integrations/slack/ - For reference

Required Files Structure

integrations/close-crm/
├── src/
│   ├── index.ts          # Main entry, OAuth spec
│   ├── schedule.ts       # Sync logic
│   ├── utils.ts          # Close CRM API utilities
│   ├── account-create.ts # OAuth/API key setup
│   └── create-activity.ts # Activity formatting
├── package.json
├── tsup.config.ts
└── README.md

Close CRM API Integration

Authentication Setup

  • Use OAuth 2.0 for public applications (recommended for integrations)
  • API Key authentication via HTTP Basic Auth (suitable for internal scripts)
  • API keys generated in Close settings

Key Endpoints

  • GET /api/v1/lead/ - List leads
  • POST /api/v1/lead/ - Create a lead
  • GET /api/v1/lead/{id}/ - Get lead details
  • PUT /api/v1/lead/{id}/ - Update a lead
  • GET /api/v1/contact/ - List contacts
  • GET /api/v1/opportunity/ - List opportunities
  • GET /api/v1/activity/ - List activities (calls, emails, notes, meetings)
  • GET /api/v1/activity/call/ - List call activities
  • GET /api/v1/activity/email/ - List email activities
  • GET /api/v1/activity/note/ - List note activities
  • GET /api/v1/activity/meeting/ - List meeting activities
  • GET /api/v1/pipeline/ - List sales pipelines
  • GET /api/v1/status/lead/ - List lead statuses
  • GET /api/v1/custom_field/lead/ - List custom fields
  • GET /api/v1/user/ - List users/team members

Events to Track

  1. Lead Management - New leads created, lead status changes, lead assignments
  2. Activities - Calls logged, emails sent/received, notes added, meetings scheduled
  3. Opportunities - New opportunities, stage changes, won/lost deals
  4. Pipeline Updates - Pipeline stage movements, deal value changes
  5. Contact Updates - New contacts added, contact information changes

Implementation Tasks

  • Set up basic integration structure following integrations/github/src/index.ts pattern
  • Implement OAuth 2.0 authentication flow in account-create.ts
  • Create API utilities in utils.ts with pagination support
  • Implement sync logic in schedule.ts for leads, activities, and opportunities
  • Convert CRM events to CORE activity format
  • Add error handling and rate limiting
  • Create integration documentation
  • Add to integrations/README.md

Technical Notes

  • Close API follows REST conventions with standard HTTP methods
  • Uses predictable URL structures: /api/v1/{resource}/
  • Supports cursor-based pagination for large datasets
  • Custom fields can be defined for leads, contacts, opportunities, and activities
  • Webhooks are available for real-time event notifications
  • API keys use HTTP Basic Auth with the API key as the username and empty password

Resources

Labels

enhancement, integration, new-feature

貢獻者指南