AI-powered behavioral intelligence — REST API v2.0
All API requests require an API key passed via the X-API-Key header.
curl -X POST https://your-domain.com/v1/scan \
-H "Content-Type: application/json" \
-H "X-API-Key: ms_live_xxxxxxxxxxxxxxxx" \
-d '{"first_name":"John","last_name":"Smith","date_of_birth":"1985-03-15"}'
ms_live_ for production or ms_test_ for testing. Keep your key secure — treat it like a password.profile_type selects the intelligence product.
| profile_type | Use Case | Primary Output |
|---|---|---|
| sales | Lead conversion | Messaging, objections, next-step scripts |
| hiring | Candidate and team fit | Role fit, management style, collaboration risk |
| leadership | Leader/team dynamics | Leadership style, delegation, conflict patterns |
| retention | Customer retention | Loyalty drivers, churn risk, engagement cadence |
| personality | General personality profiling | Traits, motivators, decision style |
depth=quick for operational execution. depth=full for strategic deep analysis.
| Mode | Credit Cost | Notes |
|---|---|---|
| quick | 1 | Fast profile response |
| full | 3 | Deep report for most products |
| leadership + full | 5 | Leadership deep analysis |
| compatibility | N + 2 | N people + synthesis credits |
Recommended endpoint flow per use case:
| Use Case | Flow |
|---|---|
| Sales Intelligence | POST /v1/scan with profile_type=sales |
| Hiring Intelligence | POST /v1/scan with profile_type=hiring, optional cv_summary |
| Leadership Intelligence | POST /v1/report with profile_type=leadership |
| Retention Intelligence | POST /v1/scan with profile_type=retention |
| Profiling Intelligence | POST /v1/compatibility with profile_type=personality |
Generate a complete behavioral sales intelligence report for a lead. Returns 18 CRM-ready fields with actionable sales insights.
| Parameter | Type | Required | Description |
|---|---|---|---|
| first_name | string | REQUIRED | Lead's first name |
| last_name | string | REQUIRED | Lead's last name |
| date_of_birth | string | REQUIRED | DOB in YYYY-MM-DD format (e.g. "1985-03-15") |
| city | string | REQUIRED | Lead's city |
| state | string | optional | Lead's state or region — depends on the country |
| country | string | REQUIRED | Lead's country |
| location_id | string | optional | GHL location/subaccount ID — enables per-location usage tracking for agencies |
| business_context | string | optional | Per-scan business context override (max 2000 characters) |
| profile_type | string | optional | sales | hiring | leadership | retention | personality (default: sales) |
| depth | string | optional | quick | full (default: quick) |
| context_role | string | optional | candidate, team_member, manager, customer, etc. |
| responsibilities | string | optional | Role responsibilities, mainly for hiring/leadership |
| cv_summary | string | optional | Pre-processed CV summary text (max 2000 chars) |
| group_id | integer | optional | Link scan to an existing group assessment |
{
"first_name": "Sarah",
"last_name": "Johnson",
"date_of_birth": "1988-07-22",
"city": "Austin",
"state": "TX",
"country": "US",
"location_id": "abc123locationXYZ",
"business_context": "Company serves US homeowners, tone should be consultative and trust-first."
}
{
"status": "success",
"lead": {
"first_name": "Sarah",
"last_name": "Johnson"
},
"report": {
"Executive_Summary": "Sarah is a vision-driven buyer who...",
"Buying_Style": "Emotionally motivated with analytical validation...",
"Psychological_Drivers": "Status, innovation, social proof...",
"Decision_Process": "Fast initial interest, needs social proof...",
"Communication_Tone": "Warm, enthusiastic, story-driven...",
"Cheat_Sheet_DO": "Lead with vision and transformation...",
"Cheat_Sheet_DONT": "Don't overwhelm with specs early...",
"Objection_Handling": "When she says 'I need to think'...",
"Messaging_Hooks": "3 high-converting angles for outreach...",
"Follow_Up_Cadence": "Day 1: Personal touch. Day 3: Value...",
"Onboarding_Strategy": "Start with quick wins to build...",
"Retention_Loyalty": "Monthly check-ins with progress data...",
"Churn_Risk": "Medium — watch for engagement drops...",
"Next_Best_Action": "Send a personalized case study...",
"Opening_Script": "Hi Sarah, I noticed you...",
"Close_Script": "Based on everything we discussed...",
"Follow_Up_Message_SMS": "Hey Sarah! Quick thought on...",
"Follow_Up_Message_Email": "Subject: Sarah, this reminded me..."
},
"usage": {
"total_scans": 142,
"monthly_scans": 38,
"scans_remaining": 62,
"plan": "enterprise"
}
}
Convenience endpoint for deep reports. Same request shape as /v1/scan but forces depth=full.
Runs quick profiles for each person, then returns a synthesis compatibility analysis.
{
"profile_type": "hiring",
"group_name": "Q1 Sales Hire",
"depth": "quick",
"people": [
{"first_name":"Alex","last_name":"Rivera","date_of_birth":"1990-01-15","city":"Austin","country":"US","context_role":"team_member"},
{"first_name":"Mia","last_name":"Cole","date_of_birth":"1995-09-21","city":"Dallas","country":"US","context_role":"candidate","cv_summary":"5 years B2B SaaS closing."}
]
}
Fetches all individual scans plus synthesis result for a previously-created group.
List cached people for your account. Reuse them in compatibility workflows.
Attach or update CV summary for a cached person (used in hiring analysis).
Check your current scan usage, remaining quota, and plan details.
{
"account": "Level Up Marketplace",
"company": "Level Up",
"usage": {
"total_scans": 142,
"monthly_scans": 38,
"scans_remaining": 62,
"plan": "enterprise",
"scan_limit": 100
}
}
Get scan usage broken down by GHL location/subaccount. Agencies use this to see which subaccounts are consuming scans — ideal for per-location billing.
Requires the same API key authentication as other endpoints.
{
"account": "My Agency",
"company": "Agency Inc",
"overall_usage": {
"total_scans": 250,
"monthly_scans": 82,
"scans_remaining": 918,
"plan": "growth"
},
"locations": [
{
"location_id": "loc_abc123",
"total_scans": 120,
"monthly_scans": 45,
"daily_scans": 3,
"last_scan_at": "2025-12-15T14:30:00"
},
{
"location_id": "loc_def456",
"total_scans": 80,
"monthly_scans": 22,
"daily_scans": 1,
"last_scan_at": "2025-12-15T11:20:00"
}
]
}
location_id with every scan request to enable this breakdown. In GHL workflows, use {{location.id}} to automatically send the subaccount ID.
Set or update your business profile used to personalize report outputs.
{
"company_name": "Acme Roofing",
"industry": "Home Services",
"value_proposition": "Fast roof replacement with premium materials.",
"services": "roof repair, roof replacement, inspections",
"target_market": "US homeowners",
"tone": "professional and consultative",
"proof_points": "500+ projects completed",
"pricing_model": "per-project"
}
{
"status": "success",
"profile": {
"company_name": "Acme Roofing",
"industry": "Home Services",
"value_proposition": "Fast roof replacement with premium materials.",
"services": "roof repair, roof replacement, inspections",
"target_market": "US homeowners",
"tone": "professional and consultative",
"proof_points": "500+ projects completed",
"pricing_model": "per-project"
}
}
Retrieve the active business profile for your API key context.
{
"status": "success",
"profile": {
"company_name": "Acme Roofing",
"industry": "Home Services",
"value_proposition": "Fast roof replacement with premium materials.",
"services": "roof repair, roof replacement, inspections",
"target_market": "US homeowners",
"tone": "professional and consultative",
"proof_points": "500+ projects completed",
"pricing_model": "per-project"
}
}
The Sales Coach is an AI-powered sales advisor that analyzes your contact's behavioral profile and CRM activity to provide real-time, personalized sales guidance. Activate a coach session on any contact, then chat to get specific scripts, messages, and strategies tailored to that person's psychology.
Activate a new coach session for a CRM contact. If an active session already exists for that contact, the existing session is returned.
{
"contact_id": "ghl_contact_abc123",
"contact_name": "John Smith",
"contact_profile": {
"Executive_Summary": "Analytical, cautious buyer..."
},
"crm_context": {
"deal_stage": "Proposal Sent",
"deal_value": "$5,000",
"last_activity": "Downloaded pricing PDF",
"recent_messages": [
{"type":"email","direction":"outbound","date":"2026-02-10","summary":"Sent proposal with 3 options"},
{"type":"sms","direction":"inbound","date":"2026-02-11","summary":"Thanks, will review this week"}
],
"notes": "Prefers morning calls. Budget approved by manager.",
"tags": ["hot-lead", "enterprise"]
}
}
{
"status": "success",
"session_id": 42,
"contact_id": "ghl_contact_abc123",
"contact_name": "John Smith",
"initial_analysis": "Here's what I see with John..."
}
Generate a secure contact-specific coach launch link for CRM custom fields.
{
"contact_id": "ghl_contact_abc123",
"contact_name": "John Smith",
"crm_context": {
"deal_stage": "Proposal Sent",
"notes": "Budget approved"
},
"auto_tag": "sales_coach"
}
{
"status": "success",
"coach_link": "https://api.mind-scan.com/coach/open?t=...",
"expires_at": "2026-02-20T10:30:00+00:00"
}
Send a message to an active coach session and receive practical next-step guidance.
{
"session_id": 42,
"message": "Can you draft an SMS to follow up on the proposal?"
}
{
"status": "success",
"session_id": 42,
"response": "Here's an SMS for John that plays to his analytical nature...",
"messages_used": 5,
"messages_remaining": 95
}
List active coach sessions for your account.
{
"status": "success",
"sessions": [
{
"session_id": 42,
"contact_id": "ghl_contact_abc123",
"contact_name": "John Smith",
"status": "active",
"message_count": 5,
"created_at": "2026-02-13T10:30:00Z"
}
]
}
Get full conversation history for a specific coach session.
{
"status": "success",
"session_id": 42,
"contact_name": "John Smith",
"session_status": "active",
"messages": [
{"role":"assistant","content":"Here's what I see with John...","created_at":"2026-02-13T10:30:02Z"},
{"role":"user","content":"Can you draft an SMS?","created_at":"2026-02-13T10:31:10Z"},
{"role":"assistant","content":"Here's an SMS for John...","created_at":"2026-02-13T10:31:12Z"}
],
"messages_used": 3,
"messages_remaining": 97
}
Close a coach session when the conversation is complete.
{
"status": "success",
"session_id": 42,
"final_message_count": 12
}
| Code | Meaning | Action |
|---|---|---|
200 | Success | Report generated — parse the report object |
400 | Bad Request | Check your request body — missing or invalid fields |
401 | Unauthorized | Invalid or missing API key in X-API-Key header |
402 | Scan Limit Reached | Plan quota exhausted — contact us to upgrade |
422 | Validation Error | Invalid date format or field values |
429 | Rate Limited | Too many requests — wait and retry |
500 | Server Error | Retry after a few seconds. If persistent, contact support |
Every scan returns exactly 18 fields. All fields are strings ready to map directly into your CRM, database, or app.
| Field | Description |
|---|---|
| Executive_Summary | High-level behavioral profile of the lead |
| Buying_Style | How they make purchase decisions |
| Psychological_Drivers | Core motivations and triggers |
| Decision_Process | Step-by-step decision-making pattern |
| Communication_Tone | How to talk to them (tone, pace, style) |
| Cheat_Sheet_DO | What TO do when selling to this person |
| Cheat_Sheet_DONT | What NOT to do — common mistakes to avoid |
| Objection_Handling | Pre-built responses to their likely objections |
| Messaging_Hooks | High-converting messaging angles |
| Follow_Up_Cadence | Optimal follow-up timing and approach |
| Onboarding_Strategy | How to onboard them after the sale |
| Retention_Loyalty | Long-term retention strategy |
| Churn_Risk | Churn risk level and prevention tactics |
| Next_Best_Action | The single most impactful next step |
| Opening_Script | Ready-to-use opening message/script |
| Close_Script | Closing script tailored to their psychology |
| Follow_Up_Message_SMS | SMS follow-up template |
| Follow_Up_Message_Email | Email follow-up template |
Each scan takes approximately 3-8 seconds under normal load. For bulk processing, we recommend queuing scans and processing them with a concurrency of 10-20 requests.
The minimum required data is first_name, last_name, and date_of_birth. Adding city, state, and country improves the quality and localization of insights.