Skip to main content

General Integration Patterns

Yes, and the HubSpot integration is a good reference architecture:
  • A CRM-side app:
    • Provides UI inside the CRM (cards, workflow actions, settings).
  • A backend connector:
    • Knows how to talk to the CRM API.
    • Uses a Tuco API key to talk to Tuco.
You can adopt this pattern for other CRMs (Salesforce, Pipedrive, etc.), always:
  • Using Tuco’s documented APIs.
  • Never calling internal worker endpoints or databases directly.

Webhooks & Events

At a minimum:
  • Message webhooks:
    • Delivery and fallback events, as documented in /api-reference/message-webhooks.
  • Generic event webhooks (where configured):
    • lead.created, lead.updated, availability.checked, etc.
Using these, your integration can:
  • Keep message statuses in sync.
  • Update contact availability.
  • Trigger follow-up actions in your own systems.
Strategies:
  • Implement a light ingress layer:
    • Validates and authenticates requests.
    • Quickly enqueues them to your own internal queue.
    • Responds to Tuco within a short timeout.
  • Process webhook payloads asynchronously:
    • Database writes and downstream calls happen in background workers.
  • Use backpressure and rate limiting internally:
    • Ensure a spike in events from Tuco does not overwhelm downstream dependencies.

HubSpot-Specific Questions

The HubSpot backend:
  • Uses HubSpot OAuth to identify the HubSpot account.
  • Asks the user to either:
    • Authenticate with Tuco, or
    • Provide a Tuco API key.
  • Stores the mapping:
    • HubSpot portal ↔ Tuco workspace ↔ Tuco API key.
After this:
  • Workflow actions and cards know which Tuco workspace to talk to.
  • All calls from the backend to Tuco use the stored API key.
Typical flows include:
  • Timeline events:
    • Outbound Tuco messages (content, channel, status).
    • Replies from recipients as inbound events.
  • Status updates:
    • Flags or properties that indicate last contacted/last replied dates.
All of this happens through:
  • Tuco → HubSpot backend via public webhooks and APIs.
  • Backend → HubSpot via officially supported HubSpot APIs.