Skip to content

Enterprise-grade GoHighLevel API integration by RJ Business Solutions - Hyper-Scalable Code. Autonomous Architectures. AI-Native Deployments.

License

Notifications You must be signed in to change notification settings

rjbizsolution23-wq/go-high-level-integration

Repository files navigation

πŸš€ GoHighLevel Integration - RJ Business Solutions

RJ Business Solutions

Intelligent. Executable. Profitable.

Hyper-Scalable Code. Autonomous Architectures. AI-Native Deployments.


A production-ready, enterprise-grade Python integration with GoHighLevel API, engineered by RJ Business Solutions. This package provides clean, scalable access to all major GoHighLevel functionalities including contacts, custom fields, tags, campaigns, workflows, and more.

🎯 RJ Business Solutions - AI Systems Architecture

Founder: Rick Jefferson | AI Systems Architect | Agent Framework Engineer | Full-Stack Code Commander

  • 500+ Businesses Engineered across 25+ industries
  • $50M+ Revenue Enabled via automation
  • 100% Production-Grade Systems deployed
  • AI-Native Infrastructure with CrewAI, LangChain, Reflexion

Core Specializations:

  • 🧠 AI & Autonomous Systems - Multi-agent frameworks, CrewAI, LangChain
  • ☁️ Cloud Engineering - AWS, GCP, Azure with Terraform, Docker, Kubernetes
  • πŸ’» Full-Stack Development - Next.js, React, Python, Go, FastAPI
  • πŸ”„ Data Engineering - Airflow, Spark, PostgreSQL, Supabase, Vector DBs

✨ Features

  • πŸš€ Complete API Coverage - All working GoHighLevel endpoints
  • πŸ”§ Credit Repair Ready - Pre-configured custom fields and tags
  • ⚑ Production Ready - Error handling, logging, and robust request management
  • 🎨 Enterprise Grade - Clean, scalable architecture for business use
  • πŸ“± Portable - Single directory that can be moved anywhere
  • 🧠 AI-Native - Built for integration with AI agents and automation

πŸ“‹ Requirements

  • Python 3.7+
  • GoHighLevel account with API access
  • API key (JWT token) and Location ID

πŸš€ Quick Start

1. Install Dependencies

pip install -r requirements.txt

2. Get Your GoHighLevel Credentials

  1. API Key (JWT Token):

    • Go to your GoHighLevel account
    • Navigate to Settings β†’ API Keys
    • Copy your JWT token
  2. Location ID:

    • Go to Settings β†’ Locations
    • Copy your Location ID

3. Basic Usage

from ghl_integration import GHLConfig, GoHighLevelIntegration

# Configure your integration
config = GHLConfig(
    api_key="your_jwt_token_here",
    location_id="your_location_id_here"
)

# Create integration instance
ghl = GoHighLevelIntegration(config)

# Test connection
if ghl.test_connection():
    print("βœ… Connected to GoHighLevel!")

    # Get contacts
    contacts = ghl.get_contacts(limit=10)
    print(f"Found {len(contacts.get('contacts', []))} contacts")

    # Get custom fields
    fields = ghl.get_custom_fields()
    print(f"Found {len(fields.get('customFields', []))} custom fields")

4. Run Quick Start

python quick_start.py

Important: Update the API_KEY and LOCATION_ID variables in quick_start.py first!


πŸ”§ Complete API Reference

Core Integration Class: GoHighLevelIntegration

πŸ” Authentication & Configuration

@dataclass
class GHLConfig:
    api_key: str          # JWT token from GoHighLevel
    location_id: str      # Location ID from GoHighLevel
    base_url: str = "https://rest.gohighlevel.com/v1"
    timeout: int = 30

πŸ“ž Contacts & CRM Operations

Get Contacts
def get_contacts(self, limit: int = 100, offset: int = 0) -> Dict[str, Any]:
    """Get all contacts with pagination"""
    # Endpoint: GET /contacts/?locationId={locationId}&limit={limit}&offset={offset}

Parameters:

  • limit (int): Maximum number of contacts to return (default: 100)
  • offset (int): Number of contacts to skip (default: 0)

Response:

{
  "contacts": [
    {
      "id": "contact_id",
      "firstName": "John",
      "lastName": "Doe",
      "email": "john@example.com",
      "phone": "+1234567890",
      "customField": {...}
    }
  ],
  "total": 150
}
Create Contact
def create_contact(self, contact_data: Dict[str, Any]) -> Dict[str, Any]:
    """Create a new contact"""
    # Endpoint: POST /contacts/

Request Body:

{
  "firstName": "John",
  "lastName": "Doe",
  "email": "john@example.com",
  "phone": "+1234567890",
  "address1": "123 Main St",
  "city": "Dallas",
  "state": "TX",
  "zipCode": "75201",
  "customField": {
    "Credit Score": 720,
    "Service Plan": "Premium"
  }
}

Response:

{
  "id": "new_contact_id",
  "firstName": "John",
  "lastName": "Doe",
  "email": "john@example.com",
  "status": "created"
}
Update Contact
def update_contact(self, contact_id: str, contact_data: Dict[str, Any]) -> Dict[str, Any]:
    """Update an existing contact"""
    # Endpoint: PUT /contacts/{contact_id}
Delete Contact
def delete_contact(self, contact_id: str) -> Dict[str, Any]:
    """Delete a contact"""
    # Endpoint: DELETE /contacts/{contact_id}
Search Contacts
def search_contacts(self, query: str, limit: int = 100) -> Dict[str, Any]:
    """Search contacts by name, email, or phone"""
    # Endpoint: GET /contacts/search?locationId={locationId}&query={query}&limit={limit}

🏷️ Custom Fields Operations

Get Custom Fields
def get_custom_fields(self) -> Dict[str, Any]:
    """Get all custom fields"""
    # Endpoint: GET /custom-fields/

Response:

{
  "customFields": [
    {
      "id": "field_id",
      "name": "Credit Score",
      "dataType": "NUMERICAL",
      "fieldKey": "credit_score",
      "picklistOptions": null
    }
  ]
}
Create Custom Field
def create_custom_field(self, field_data: Dict[str, Any]) -> Dict[str, Any]:
    """Create a custom field"""
    # Endpoint: POST /custom-fields/

Request Body:

{
  "name": "Company Size",
  "dataType": "SINGLE_OPTIONS",
  "options": ["1-10", "11-50", "51-200", "200+"]
}

Supported Data Types:

  • TEXT - Single line text
  • LARGE_TEXT - Multi-line text
  • NUMERICAL - Numbers
  • DATE - Date fields
  • MONETORY - Currency amounts
  • SINGLE_OPTIONS - Dropdown with single selection
  • MULTIPLE_OPTIONS - Dropdown with multiple selection
  • RADIO - Radio button options
  • CHECKBOX - Checkbox options
  • PHONE - Phone number fields
  • FILE_UPLOAD - File upload fields
Update Custom Field
def update_custom_field(self, field_id: str, field_data: Dict[str, Any]) -> Dict[str, Any]:
    """Update a custom field"""
    # Endpoint: PUT /custom-fields/{field_id}
Delete Custom Field
def delete_custom_field(self, field_id: str) -> Dict[str, Any]:
    """Delete a custom field"""
    # Endpoint: DELETE /custom-fields/{field_id}

🏷️ Tags Operations

Get Tags
def get_tags(self) -> Dict[str, Any]:
    """Get all tags"""
    # Endpoint: GET /tags/?locationId={location_id}
Create Tag
def create_tag(self, tag_data: Dict[str, Any]) -> Dict[str, Any]:
    """Create a new tag"""
    # Endpoint: POST /tags/

Request Body:

{
  "name": "VIP Client",
  "color": "#FFD700"
}
Add Tags to Contact
def add_tags_to_contact(self, contact_id: str, tags: List[str]) -> Dict[str, Any]:
    """Add tags to a contact"""
    # Endpoint: POST /contacts/{contact_id}/tags

Request Body:

{
  "tags": ["VIP Client", "Active", "Premium Plan"]
}
Remove Tags from Contact
def remove_tags_from_contact(self, contact_id: str, tags: List[str]) -> Dict[str, Any]:
    """Remove tags from a contact"""
    # Endpoint: DELETE /contacts/{contact_id}/tags

πŸ“’ Campaigns Operations (Read-Only)

Get Campaigns
def get_campaigns(self) -> Dict[str, Any]:
    """Get all campaigns"""
    # Endpoint: GET /campaigns/?locationId={location_id}

Note: Campaigns are read-only via API. Create them manually in GoHighLevel UI.

πŸ”„ Workflows Operations (Read-Only)

Get Workflows
def get_workflows(self) -> Dict[str, Any]:
    """Get all workflows"""
    # Endpoint: GET /workflows/?locationId={location_id}

Note: Workflows are read-only via API. Create them manually in GoHighLevel UI.

πŸ“‹ Forms Operations

Get Forms
def get_forms(self) -> Dict[str, Any]:
    """Get all forms"""
    # Endpoint: GET /forms/?locationId={location_id}
Get Form Submissions
def get_form_submissions(self, form_id: str) -> Dict[str, Any]:
    """Get form submissions"""
    # Endpoint: GET /forms/submissions?locationId={location_id}&formId={form_id}

πŸ”§ Utility Operations

Test Connection
def test_connection(self) -> bool:
    """Test API connection by attempting to get contacts"""
Get Location Info
def get_location_info(self) -> Dict[str, Any]:
    """Get location information"""
    # Endpoint: GET /locations/{location_id}
Get User Info
def get_user_info(self) -> Dict[str, Any]:
    """Get current user information"""
    # Endpoint: GET /users/

πŸ—οΈ Credit Repair Specialized Integration

Class: CreditRepairIntegration

Extends GoHighLevelIntegration with credit repair specific functionality.

Automatic Setup

def setup_credit_repair_system(self):
    """Initialize credit repair specific custom fields and tags"""
    # Automatically creates:
    # - Credit repair custom fields
    # - Credit repair tags
    # - Service plan options
    # - Status tracking

Pre-Configured Custom Fields

  • Credit Score - NUMERICAL
  • Credit Report Date - DATE
  • Dispute Items - NUMERICAL
  • Service Plan - SINGLE_OPTIONS (Basic, Standard, Premium, VIP)
  • Start Date - DATE
  • Monthly Fee - MONETORY
  • Payment Method - SINGLE_OPTIONS (Credit Card, ACH, PayPal, Check)
  • Status - SINGLE_OPTIONS (Prospect, Client, Active, Paused, Completed, Cancelled)

Pre-Configured Tags

  • Credit Repair Client
  • Prospect, Active Client, Paused Client, Completed Client
  • High Priority, Payment Issue, Credit Score Improved
  • Disputes Filed, Follow Up Required
  • New Lead, Qualified Lead, Unqualified Lead
  • VIP Client, Basic Plan, Standard Plan, Premium Plan, VIP Plan

Add Contact to Credit Repair System

def add_contact_to_credit_repair_system(self, contact_data: Dict[str, Any]) -> Dict[str, Any]:
    """Add a contact to the credit repair system with proper tagging"""
    # 1. Creates the contact
    # 2. Automatically adds appropriate tags based on:
    #    - Status (Prospect Client, Active Client, etc.)
    #    - Service Plan (Basic Plan, Premium Plan, etc.)
    # 3. Returns the created contact

πŸ“ File Structure

go-high-level-integration/
β”œβ”€β”€ πŸš€ ghl_integration.py      # Core integration module
β”œβ”€β”€ ⚑ quick_start.py          # Quick start example
β”œβ”€β”€ πŸ“š example_usage.py        # Comprehensive examples
β”œβ”€β”€ πŸ§ͺ test_integration.py     # Test your setup
β”œβ”€β”€ πŸ”§ setup.py               # Automated setup script
β”œβ”€β”€ βš™οΈ config_template.py     # Configuration template
β”œβ”€β”€ πŸ“¦ requirements.txt        # Python dependencies
β”œβ”€β”€ πŸ“– README.md              # This comprehensive documentation
β”œβ”€β”€ πŸš€ GETTING_STARTED.md     # Quick start guide
└── πŸͺŸ setup.bat              # Windows batch file

🚨 Important Notes

  1. Campaigns & Workflows: These are read-only via API. You must create them manually in the GoHighLevel UI.

  2. API Limits: GoHighLevel has rate limits. The integration includes automatic retry logic.

  3. Authentication: Always use JWT tokens (not OAuth) for direct API access.

  4. Custom Fields: The objectKey is automatically generated from the field name.

  5. Production Use: This integration is designed for enterprise use with proper error handling and logging.


πŸ› Troubleshooting

Common Issues

  1. "Invalid JWT" Error:

    • Check your API key is correct
    • Ensure you're using the JWT token, not OAuth credentials
  2. "Location not found" Error:

    • Verify your Location ID is correct
    • Check you have access to that location
  3. "Custom field already exists" Error:

    • This is normal - the field was already created
    • The integration handles this gracefully
  4. Rate Limiting:

    • GoHighLevel limits API calls
    • The integration includes delays between requests

Debug Mode

Enable detailed logging:

import logging
logging.basicConfig(level=logging.DEBUG)

πŸ“ž Support & Contact

For Integration Issues:

  1. Check the troubleshooting section above
  2. Verify your GoHighLevel credentials
  3. Check the GoHighLevel API documentation

For GoHighLevel Account Issues:

  • Contact GoHighLevel support directly

RJ Business Solutions Contact:


πŸ“„ License & Usage

This integration is provided by RJ Business Solutions for GoHighLevel users. Use at your own risk in accordance with GoHighLevel's terms of service.

RJ Business Solutions Promise:

"We don't deliver MVPsβ€”we deploy automated, intelligent infrastructure that works, scales, and makes money."


πŸ”„ Updates & Maintenance

This integration is based on the official GoHighLevel API documentation and is updated as the API evolves. RJ Business Solutions maintains this integration for enterprise use.


Built with ❀️ by RJ Business Solutions

Intelligent. Executable. Profitable.

About

Enterprise-grade GoHighLevel API integration by RJ Business Solutions - Hyper-Scalable Code. Autonomous Architectures. AI-Native Deployments.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published