Create a GoHighLevel install link
A link that installs the Mythic GoHighLevel app on one sub-account and links it to this client. Give install_url to someone who can log in to that GoHighLevel account. They must pick a single sub-account; an agency-level install is not linked.
The link does not expire. The return to return_url works for return_expires_in seconds. After that, GET /client/v1/locations/ghl still links the install. On return, return_url receives mythic_ghl=connected&ghl_location_id=…, or mythic_ghl=error&mythic_error=<code>.
curl -X POST "https://mythic-analytics.gulp.workers.dev/client/v1/locations/ghl/install?location_id=example_string" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"return_url": "https://app.example.com/clients/123"
}'
import requests
import json
url = "https://mythic-analytics.gulp.workers.dev/client/v1/locations/ghl/install?location_id=example_string"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"return_url": "https://app.example.com/clients/123"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://mythic-analytics.gulp.workers.dev/client/v1/locations/ghl/install?location_id=example_string", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"return_url": "https://app.example.com/clients/123"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"return_url": "https://app.example.com/clients/123"
}`)
req, err := http.NewRequest("POST", "https://mythic-analytics.gulp.workers.dev/client/v1/locations/ghl/install?location_id=example_string", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://mythic-analytics.gulp.workers.dev/client/v1/locations/ghl/install?location_id=example_string')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"return_url": "https://app.example.com/clients/123"
}'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"install_url": "example_string",
"ghl_app_id": "6827fcaec3217895d84d469e",
"return_expires_in": 86400
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Please try again later",
"code": 429,
"retryAfter": 3600
}
{
"error": "Service Unavailable",
"message": "The service is temporarily unavailable. Please try again later",
"code": 503
}
/client/v1/locations/ghl/install
Target server for requests. Edit to use your own host.
Agency key (ak_) or location secret key (sk_). Writes require an agency key; creating a client requires an agency-wide key. Keys are server-side credentials — this surface serves no CORS headers on purpose. Scoped keys (mcp_) are accepted too: locations:read/locations:write for one client's setup, and provisioning:write to create a client. See Using an mcp_ key over HTTP.
ak_) or location secret key (sk_). Writes require an agency key; creating a client requires an agency-wide key. Keys are server-side credentials — this surface serves no CORS headers on purpose. Scoped keys (mcp_) are accepted too: locations:read/locations:write for one client's setup, and provisioning:write to create a client. See Using an mcp_ key over HTTP.Location to scope to. Required for ak_ keys (or send the X-Location-Id header); ignored for sk_. Not used when creating a client.
The media type of the request body
Where to send the browser afterwards. Its origin must be in the agency's oauth_return_origins.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. Agency key (ak_) or location secret key (sk_). Writes require an agency key; creating a client requires an agency-wide key. Keys are server-side credentials — this surface serves no CORS headers on purpose. Scoped keys (mcp_) are accepted too: locations:read/locations:write for one client's setup, and provisioning:write to create a client. See Using an mcp_ key over HTTP.
Query Parameters
Location to scope to. Required for ak_ keys (or send the X-Location-Id header); ignored for sk_. Not used when creating a client.
Body
Where to send the browser afterwards. Its origin must be in the agency's oauth_return_origins.
https://app.example.com/clients/123