EBCD
Back to Blog
AI/Automation8 min read

Claude Code + GoHighLevel API: How We Built an Instagram Content Autopilot

We connected Claude Code to GoHighLevel's API and built a pipeline that generates, renders, and posts Instagram carousels automatically. One API unlocked everything.

Chris Luna·

I typed one command. Claude Code generated 70 carousel slides from 10 blog posts, rendered them to PNG, uploaded them to our CRM, and scheduled 2 posts per day on Instagram for the next 5 days. Including the carousel that told you about this article.

No Canva. No scheduling tool. No designer. One AI agent connected to one API.

The API was GoHighLevel. And the reason this matters isn't the Instagram carousels — it's what connecting to that single API unlocked for everything else.

Why GoHighLevel's API Is the Most Underrated Asset in Marketing

Most agencies use GoHighLevel as a CRM. They log in, manage contacts, send emails through the UI, and maybe set up a workflow or two. That's using maybe 10% of the platform.

The GHL API exposes everything. One API key — one authenticated connection — gives you programmatic access to:

  • Social Media Planner — post to Instagram, Facebook, Google Business Profile, TikTok, LinkedIn
  • Contact Management — create, update, tag, search, and segment contacts at scale
  • Email Marketing — send individual emails or mass campaigns with full HTML templates
  • SMS/Text Messaging — send and receive text messages, run drip sequences
  • Calendar/Booking — create appointments, check availability, manage calendar slots
  • Media Library — upload images, videos, and files to GHL's CDN
  • Opportunities/Pipeline — manage deals, move stages, track revenue
  • Conversations — read and send messages across all channels (SMS, email, chat, social DMs)
  • Forms and Surveys — create and manage form submissions
  • Workflows — trigger automations programmatically
  • Invoicing/Payments — create invoices, track payments

That's not 12 different integrations. It's one API key. One authentication. One endpoint base (services.leadconnectorhq.com). Every feature GHL offers in its UI is available through the API — and Claude Code can call all of them.

The Instagram Carousel Pipeline: Step by Step

Here's exactly how the autopilot works. This isn't theoretical — this is the system that posted the carousel that brought you to this article.

Step 1: Content Extraction

Claude Code reads our blog posts and extracts the key insights — the data points, the frameworks, the counterintuitive angles that make good social content. Each blog post becomes a carousel data structure: a cover hook, 5 content slides, and a CTA slide.

Step 2: HTML Slide Generation

Each slide is generated as a standalone HTML file at 1080x1080 pixels (Instagram's square format). The design system is coded once — brand colors, typography, layout rules — and every carousel follows it automatically. No design decisions per post. No template dragging.

Our brand system: purple (#6A00FF) for authority, blue (#0066FF) for trust, pink (#FF2D9A) for CTAs. Every slide, every carousel, every time. Consistency at scale without a brand designer reviewing every asset.

Step 3: PNG Rendering

Claude Code uses Playwright (a headless browser) to screenshot each HTML slide into a high-resolution PNG. 7 slides per carousel, 10 carousels — 70 images rendered in under a minute.

Step 4: GHL Media Upload

Each PNG gets uploaded to GoHighLevel's media library via the API:

POST /medias/upload-file
Authorization: Bearer {API_KEY}

GHL returns a CDN URL for each uploaded image. These URLs become the media array for the Instagram post.

Step 5: Post or Schedule via Social Planner

The final API call creates the Instagram post through GHL's Social Planner:

POST /social-media-posting/{locationId}/posts

We pass the media URLs, the caption, the Instagram account ID, and either "status": "in_progress" (post now) or "status": "scheduled" with a future date. GHL handles the actual Instagram API communication.

One command. Blog content becomes Instagram carousels. Rendered, uploaded, and posted — or scheduled across multiple days at specific times.

What Else We've Built on the Same API

The carousel autopilot was built in one session. But because GHL's API is unified, the same connection powers everything else:

Automated Lead Routing

When someone fills out a form on one of our client websites, Claude Code's pipeline hits the GHL Contact API to create the contact, apply tags, add them to a pipeline, and trigger a workflow — all through the same API key we use for Instagram posting.

Client Reporting with Real Data

Our reporting scripts pull opportunity data, contact counts, and pipeline metrics directly from GHL's API. No manual exports. No CSV downloads. The dashboard refreshes automatically because it's reading from the same API.

Mass Email Campaigns

The same API key that posts carousels can also send HTML emails to segmented contact lists. We build the email template in Claude Code, segment the audience through the API, and trigger the send — all without logging into GHL's UI.

SMS Follow-Up Sequences

Speed to lead matters. Our AI calling system uses GHL's Conversations API to send immediate text messages when a new lead comes in. Same API. Same authentication. Different endpoint.

Calendar Booking

Our website lead forms don't just create contacts — they book appointments on specific calendars through GHL's Calendar API. The lead gets confirmed, the sales rep gets notified, and the contact goes into a nurture sequence. One API call chains into the next.

Why Claude Code Makes This Possible

You could build all of this with traditional development. Hire a developer, set up a Node.js server, write API integration code, deploy it somewhere, maintain it when things break.

Or you could tell Claude Code what you want in plain English.

The difference isn't capability — it's speed and accessibility. Claude Code:

  • Reads your existing codebase and builds on top of it. It doesn't start from scratch every time.
  • Handles API authentication, error handling, and edge cases without you specifying them.
  • Runs from your phone. The entire carousel pipeline — generation, rendering, posting — was built and executed from Claude Code's mobile app.
  • Costs $20/month. Not per API call. Not per seat. Flat rate, unlimited usage.

The mental model shift: you're not writing code. You're describing systems. Claude Code translates your description into working automation that connects directly to your business tools.

The Compounding Effect

Here's what most people miss about API-first automation: it compounds.

The carousel pipeline didn't exist three hours ago. Now it runs automatically. Tomorrow we'll add a trigger that generates a new carousel every time we publish a blog post. Next week we'll extend it to post across all 13 client accounts — each with their own brand colors, their own GHL location, their own Instagram account.

Every automation we build makes the next one faster. The GHL API wrapper we wrote for carousels is the same one that powers reporting, lead routing, and email campaigns. The Playwright rendering pipeline we built for carousels can render any HTML to any image — ad creatives, client reports, social proof graphics.

One API connection. One AI agent. Unlimited automation surface area.

The System Behind the Post You're Reading

Let's make this concrete. The carousel that brought you to this article was:

  1. Written by Claude Code, extracting insights from this blog post
  2. Designed using our coded brand system (purple/blue/pink gradient, Inter font, 1080x1080 squares)
  3. Rendered to PNG by Playwright running inside Claude Code
  4. Uploaded to GoHighLevel's media CDN via API
  5. Posted to our Instagram account via GHL's Social Planner API

Total time from "create a carousel about this" to live on Instagram: under 3 minutes. Total cost beyond the Claude Code subscription: $0.

That's not a demo. That's our actual production workflow. And the same API connection that posted it can send you a follow-up email, book you on our calendar, add you to a nurture sequence, and move you through a sales pipeline.

One API. One agent. Everything connected.

Start Building Your Own Pipeline

You don't need to be technical. You need a GoHighLevel account (you probably already have one), a Claude Code subscription ($20/month), and a clear idea of what you want to automate first.

Start with the highest-friction task in your workflow. For us, it was content creation and posting. For you, it might be reporting, lead follow-up, or client onboarding. The API surface is the same either way.

If you want to see this system in action — the carousel pipeline, the reporting automation, the full GHL API integration — book a call. We'll walk you through exactly how it's built and how to adapt it to your agency.

Want Results Like This for Your Business?

Book a Strategy Call