Skip to Content
Uncodie Market Fit está disponible 🎉
Rest APIAgentsSalesLead Follow-up Command

Lead Follow-up Command

Creates a personalized follow-up sequence for sales leads using a two-phase process: first a Sales/CRM Specialist creates the content strategy, then a Content Creator & Copywriter refines the messaging for maximum impact.

Endpoint

POST /api/agents/sales/leadFollowUp

Request Body

ParameterTypeRequiredDescription
siteIdstringYesID of the website where the lead originated
leadIdstringYesID of the lead to follow up with
userIdstringNoID of the sales representative responsible for the lead
agent_idstringNoID of the agent to handle the follow-up sequence
followUpTypestringNoType of follow-up (e.g., “email”, “call”, “meeting”)
leadStagestringNoCurrent stage of the lead in the sales pipeline
previousInteractionsarrayNoArray of previous interactions with the lead
leadDataobjectNoAdditional data about the lead (e.g., interests, pain points)
productInterestarrayNoArray of products or services the lead has shown interest in
followUpIntervalstringNoDesired interval for follow-ups (e.g., “3 days”, “1 week”)

Example Request

{ "siteId": "site_456", "leadId": "lead_789", "userId": "user_123", "agent_id": "agent_sales_123", "followUpType": "email", "leadStage": "qualified", "previousInteractions": [ { "date": "2024-04-15", "type": "email", "summary": "Initial contact with product information" }, { "date": "2024-04-20", "type": "call", "summary": "Discussed specific product features and pricing" } ], "leadData": { "name": "Jane Smith", "company": "Acme Inc.", "email": "jane@acme.com", "phone": "+1234567890", "position": "Marketing Director", "pain_points": ["time-consuming content creation", "measuring ROI"], "budget_range": "$5000-$10000" }, "productInterest": ["content automation", "analytics dashboard"], "followUpInterval": "3 days" }

Try It

Lead Follow-up API Tester

Use this tester to generate lead follow-up sequences with different parameters and see the results.

You can test this API directly using our API Tester interface. The Sales API tester allows you to generate lead follow-up sequences with different parameters and see the results.

Required fields:

  • Site ID: The ID of the website where the lead originated
  • Lead ID: The ID of the lead to follow up with

Optional fields:

  • User ID: The ID of the sales representative responsible for the lead
  • Agent ID: The ID of the agent to handle the follow-up sequence
  • Follow-up Type: Type of follow-up desired (email, call, meeting)
  • Lead Stage: Current stage of the lead in the sales pipeline
  • Previous Interactions: Array of previous interactions with the lead
  • Lead Data: Additional data about the lead including contact information
  • Product Interest: Array of products or services the lead has shown interest in
  • Follow-up Interval: Desired interval for follow-ups

The API Tester makes it easy to see example requests in various programming languages and test the endpoint directly.

How It Works

The system uses a two-phase process to create high-quality follow-up content:

Phase 1: Sales Strategy

  • Sales/CRM Specialist Agent analyzes the lead information
  • Creates initial follow-up content with sales strategy
  • Focuses on lead qualification and conversion objectives

Phase 2: Content Refinement (Optional)

  • Content Creator & Copywriter Agent refines the messaging
  • Improves copy, tone, and persuasion techniques
  • Enhances engagement while maintaining sales objectives

Available Channels

The system automatically generates content for available channels based on lead data:

  • Email: Generated if lead has email address
  • WhatsApp: Generated if lead has phone number
  • Notification: In-app notifications (always available)
  • Web: Website popups/banners (always available)

Response Structure

Success Response

{ "success": true, "data": { "messages": { "email": { "title": "Following up on your content automation interest", "message": "Hi Jane,\n\nI hope this email finds you well. I wanted to follow up on your interest in content automation solutions...", "strategy": "comprehensive sale strategy" }, "whatsapp": { "title": "Quick follow-up about Acme Inc's automation needs", "message": "Hi Jane! Following up on our conversation about content automation. Are you available for a quick chat this week?", "strategy": "comprehensive sale strategy" }, "notification": { "title": "New content automation insights for Acme Inc", "message": "We've prepared a personalized demo showing how our platform can save your team 15+ hours per week on content creation.", "strategy": "comprehensive sale strategy" }, "web": { "title": "Exclusive Demo for Marketing Directors", "message": "See how companies like Acme Inc are automating their content workflows and measuring ROI more effectively.", "strategy": "comprehensive sale strategy" } }, "lead": { "name": "Jane Smith", "company": "Acme Inc.", "email": "jane@acme.com", "phone": "+1234567890", "position": "Marketing Director", "pain_points": ["time-consuming content creation", "measuring ROI"], "budget_range": "$5000-$10000", "sites": { "name": "Acme Website", "url": "https://acme.com" } }, "command_ids": { "sales": "cmd_sales_123456", "copywriter": "cmd_copywriter_789012" } } }

Error Response

{ "success": false, "error": { "code": "INVALID_REQUEST", "message": "siteId is required" } }

Response Fields

Messages Object

Each channel contains:

  • title: Subject line or headline for the message
  • message: The main content body
  • strategy: The sales strategy applied

Lead Object

Contains all available lead information:

  • Basic info: name, company, email, phone, position
  • Sales data: pain_points, budget_range, lead_stage
  • Site information: sites object with website details
  • Interaction history and preferences

Command IDs Object

  • sales: ID of the Sales/CRM Specialist command
  • copywriter: ID of the Copywriter command (null if not executed)

Error Codes

CodeDescription
INVALID_REQUESTRequired parameters missing (siteId or leadId)
AGENT_NOT_FOUNDSpecified agent was not found
SALES_COMMAND_FAILEDSales command did not complete successfully
SYSTEM_ERRORInternal system error occurred

Notes

  • The system automatically finds active Sales/CRM Specialist and Content Creator & Copywriter agents for the site
  • If no copywriter is found, only the sales phase executes
  • Content is personalized based on lead data and previous interactions
  • Messages are ready-to-send without placeholders or variables
  • All content is generated with the actual lead information, not templates
Last updated on