RATIO MACHINA STARTER logo

MERCURY

Quickstart Guide

This quickstart guide will walk you through setting up your first Mercury sales persona and integrating it with external workflow platforms in under 30 minutes. We'll cover both UI configuration and API integration to demonstrate Mercury's flexible, streamlined approach to conversation automation.

Prerequisites

  • Mercury account with API access
  • API key for authentication
  • Access to Mercury UI dashboard
  • External platform account (GoHighLevel, Kartra, Zapier, n8n, or Make)

Part 1: Configure Your Sales Persona (Mercury UI)

Step 1: Create Your Sales Persona

  1. 1. Log into Mercury UI and navigate to Personas → Create New
  2. 2. Select the "Sales" persona template
  3. 3. Configure basic information:
    • Name: "Sales Assistant Alex"
    • External ID: "sales-alex-v1" (for API integration)
    • Role: "Sales Representative"
    • Channel: "SMS" or "Email" based on your platform
  4. 4. Set the conversational tone:
    • Tone: "Professional, friendly, and consultative"
    • Communication Style: "Direct but empathetic, focused on understanding customer needs"
  5. 5. Add business context:
    • Business Description: Describe your company, products, and value proposition
    • Target Audience: Define your ideal customer profile
    • Competitive Advantages: List key differentiators

Step 2: Set Up Offers and Objections

Configure common sales scenarios and responses:

Offers Configuration

{
  "offers": [
    {
      "title": "Free Consultation",
      "description": "30-minute strategy session to identify your specific needs",
      "value_proposition": "Personalized insights with no commitment"
    },
    {
      "title": "Product Demo",
      "description": "Live demonstration of our platform's core features",
      "value_proposition": "See exactly how our solution fits your workflow"
    }
  ]
}

Objections and Responses

{
  "objections": [
    {
      "objection": "It's too expensive",
      "response": "I understand budget is important. Let's explore our flexible pricing options and ROI calculator to find a solution that works for you."
    },
    {
      "objection": "We need to think about it",
      "response": "Absolutely, this is an important decision. What specific aspects would you like to discuss further? I can provide additional information to help with your evaluation."
    }
  ]
}

Step 3: Test Your Persona

  1. 1. Navigate to the Testing Environment in Mercury UI
  2. 2. Start a test conversation with your persona
  3. 3. Try different scenarios:
    • Initial prospect inquiry
    • Price objection handling
    • Feature questions
    • Scheduling requests
  4. 4. Refine responses and save the persona

Part 2: API Integration with External Platforms

Understanding the POST /conversations RPC API

The POST /conversations RPC API is Mercury's primary integration endpoint. It handles resource upserts (create or update) and conversation initiation in a single call.

Key Features:

  • Automatic persona, contact, and conversation creation/updates
  • Intelligent message threading for ongoing conversations
  • Real-time AI response generation
  • External ID support for seamless CRM integration

Step 4: Basic Integration Setup

API Endpoint Configuration

Base URL: https://your-api-name.mercury.ratiomachina.com
Endpoint: POST /conversations
Headers:
  Content-Type: application/json
  x-mercury-api-key: YOUR_API_KEY

Request Structure

{
  "persona": {
    "externalId": "sales-alex-v1",
    "name": "Sales Assistant Alex",
    "data": {
      "role": "sales",
      "tone": "professional_friendly",
      "business_description": "Your business description"
    }
  },
  "contact": {
    "externalId": "contact_12345",
    "name": "John Smith",
    "data": {
      "email": "john@example.com",
      "phone": "+1234567890",
      "lead_source": "website_form"
    }
  },
  "conversation": {
    "externalId": "conv_website_john_smith",
    "channel": "sms"
  },
  "message": {
    "content": "Hi! I'm interested in learning more about your services.",
    "sender": "contact"
  }
}

Step 5: Platform-Specific Integrations

🔥 GoHighLevel Integration

Configure Mercury as a webhook in your GoHighLevel workflow:

Webhook Configuration:

URL: https://your-api-name.mercury.ratiomachina.com/conversations
Method: POST
Headers: {
  "Content-Type": "application/json",
  "x-mercury-api-key": "your_api_key"
}

Field Mapping:

{
  "persona": {
    "externalId": "sales-alex-v1"
  },
  "contact": {
    "externalId": "ghl_contact_{{contact.id}}",
    "name": "{{contact.first_name}} {{contact.last_name}}",
    "data": {
      "email": "{{contact.email}}",
      "phone": "{{contact.phone}}",
      "ghl_contact_id": "{{contact.id}}"
    }
  },
  "conversation": {
    "externalId": "ghl_conv_{{contact.id}}_{{workflow.id}}",
    "channel": "sms"
  },
  "message": {
    "content": "{{trigger.message}}",
    "sender": "contact"
  }
}

🎯 Kartra Integration

Set up Mercury as a webhook action in Kartra sequences:

{
  "persona": {
    "externalId": "sales-alex-v1"
  },
  "contact": {
    "externalId": "kartra_lead_[lead_id]",
    "name": "[first_name] [last_name]",
    "data": {
      "email": "[email]",
      "kartra_lead_id": "[lead_id]",
      "sequence_name": "[sequence_name]"
    }
  },
  "conversation": {
    "externalId": "kartra_conv_[lead_id]_[sequence_id]",
    "channel": "email"
  },
  "message": {
    "content": "[custom_field_inquiry]",
    "sender": "contact"
  }
}

⚡ Zapier Integration

Create a Zapier webhook action:

Zap Configuration:

  • Trigger: Form submission, new lead, etc.
  • Action: Webhooks by Zapier → POST
  • URL: Your Mercury API endpoint
  • Payload Type: JSON

Dynamic Field Mapping:

{
  "persona": {
    "externalId": "sales-alex-v1"
  },
  "contact": {
    "externalId": "zapier_{{lead_id}}",
    "name": "{{first_name}} {{last_name}}",
    "data": {
      "email": "{{email}}",
      "source": "{{lead_source}}"
    }
  },
  "conversation": {
    "externalId": "zapier_conv_{{lead_id}}_{{zap_meta_human_now}}",
    "channel": "sms"
  },
  "message": {
    "content": "{{inquiry_message}}",
    "sender": "contact"
  }
}

Step 6: Handle the API Response

Mercury returns comprehensive conversation data including the AI-generated response:

Response Structure:

{
  "conversation": {
    "id": "uuid-here",
    "externalId": "conv_website_john_smith",
    "channel": "sms"
  },
  "persona": {
    "id": "uuid-here",
    "externalId": "sales-alex-v1",
    "name": "Sales Assistant Alex"
  },
  "contact": {
    "id": "uuid-here",
    "externalId": "contact_12345",
    "name": "John Smith"
  },
  "messages": [
    {
      "id": "uuid-here",
      "content": "Hi! I'm interested in learning more about your services.",
      "sender": "contact",
      "createdAt": "2024-01-15T10:30:00Z"
    },
    {
      "id": "uuid-here",
      "content": "Hello John! I'd be happy to help you learn more about our services. Based on your inquiry, I can see you're looking for solutions that could benefit your business. What specific challenges are you hoping to address?",
      "sender": "persona",
      "createdAt": "2024-01-15T10:30:02Z"
    }
  ]
}

Step 7: Automate Follow-up with AI Response Generation

Use the AI response from Mercury to automate your platform's follow-up actions:

Extract AI Response

// Get the latest persona message
const aiResponse = response.messages
  .filter(msg => msg.sender === 'persona')
  .pop()
  .content;

Platform Actions

  • GoHighLevel: Send SMS/Email with AI response, update contact record, trigger next workflow step
  • Kartra: Send sequence email, update lead score, move to next sequence step
  • Zapier: Create follow-up actions, update CRM records, send notifications

Part 3: Monitoring and Optimization

Step 8: Set Up Monitoring

  1. 1. Navigate to Monitors → Create Monitor in Mercury UI
  2. 2. Configure monitoring rules:
    • Sentiment analysis for customer satisfaction
    • String analysis for specific keywords ("pricing", "competitor")
    • Escalation triggers for complex inquiries
  3. 3. Set up alerts for your team when thresholds are met

Step 9: Track Performance

Monitor key metrics in Mercury UI:

  • Conversation Volume: Track engagement levels
  • Response Quality: Monitor AI response accuracy
  • Conversion Metrics: Measure lead progression
  • Escalation Rates: Track when human intervention is needed

Best Practices for Production

  • Rate Limiting: Implement appropriate rate limiting for your API calls
  • Error Handling: Build robust error handling and retry logic
  • Testing: Use separate personas for development and production
  • Security: Store API keys securely and rotate them regularly
  • Monitoring: Set up comprehensive monitoring and alerting
  • Backup: Maintain conversation history and persona configurations

🎉 Congratulations!

You now have a fully functional Mercury sales persona integrated with your external workflow platform. Your AI assistant is ready to handle prospect inquiries, qualify leads, and provide personalized responses 24/7.

Next Steps

Explore Advanced Features

  • Set up skills for external API integrations
  • Create evaluation suites for quality assurance
  • Configure advanced monitoring rules
  • Implement multi-persona workflows

Scale Your Implementation

  • Create personas for different use cases
  • Set up comprehensive monitoring dashboards
  • Implement advanced integrations with custom skills
  • Build automated quality assurance workflows
Transcend the hype with MERCURY by Ratio Machina