Skip to main content
When a campaign reply is classified as positive (interested, meeting booked, etc.), Leadterra can hand it off to a Sales Development Rep (SDR). The SDR’s personal Gmail is connected via Composio, enabling AI-generated draft replies, one-click sending, and automatic follow-up scheduling — all orchestrated through the public API.

How it works

  1. Reply classification — Inbound replies are classified by AI (interested, not_interested, meeting_booked, etc.)
  2. Assignment — A positive reply is assigned to an SDR via POST /v1/replies/:replyId/assign, creating a prospect thread in the SDR’s inbox
  3. Draft generation — The SDR (or an agent) calls POST /v1/sdr/drafts/generate to produce an AI-suggested reply
  4. Review and send — The draft can be edited via PATCH /v1/sdr/drafts/:draftId, then sent through the SDR’s connected Gmail with POST /v1/sdr/drafts/:draftId/send
  5. Follow-up automation — Follow-up tasks are scheduled automatically based on admin-configured rules, and can be managed via API

Authentication

SDR endpoints require an API key with role: "sdr" and a linked sdrId. Create one in the dashboard under Settings → API Keys, specifying the SDR profile to link.

Gmail connection

SDRs send replies through their own connected Gmail account via Composio. Check connection status with GET /v1/sdr/gmail/status. Gmail OAuth setup is currently browser-only — the SDR must connect their Gmail through the dashboard.

Thread lifecycle

Thread status transitions are validated against a state machine. Invalid transitions return a 400 error with the allowed transitions.