| Method | Path | Description |
| GET | /ghl/media/files | List files/folders (location_id, opt type, query, limit, parent_id, fetch_all) |
| POST | /ghl/media/upload | Import URL into media library → {"fileId", "url"} (location_id, url, name, opt parent_id) |
| DELETE | /ghl/media/file | Delete a file (location_id, file_id) |
| PUT | /ghl/media/file | Rename a file (location_id, file_id, name) |
| POST | /ghl/media/folder | Create a folder (location_id, name, opt parent_id) |
| PUT | /ghl/media/bulk-rename | Rename many files (location_id, body: [{"id","name"}]) |
| PUT | /ghl/media/bulk-delete | Trash / restore / delete many (location_id, body: ["id1",...], opt status_action) |
| Method | Path | Description |
| GET | /ghl/custom-values | Live read-through of all custom values (location_id) → {customValues: [{id, name, key, value, folder}]} |
| GET | /ghl/custom-value | Fetch a single custom value (location_id, custom_value_id) → {customValue} |
| POST | /ghl/custom-values | Create a custom value (body: {location_id, name, value}) → {customValue} |
| POST | /ghl/custom-values/bulk-upsert | Create/update multiple custom values (body: {location_id, items: [{name, value}]}) → {created, updated, errors} |
| POST | /ghl/custom-values/bulk-upsert-async | Enqueue throttled bulk upsert (body: {location_id, items: [{name, value}]}) → 202 {batch_id} |
| POST | /ghl/custom-values/bulk-delete-async | Enqueue throttled bulk delete (body: {location_id, custom_value_ids: [str]}) → 202 {batch_id} |
| GET | /ghl/custom-values/batches/{batch_id} | Poll async batch status → batch record (404 if not found) |
| PUT | /ghl/custom-value | Update a custom value (body: {location_id, custom_value_id, value, name?}) → {customValue} |
| DELETE | /ghl/custom-value | Delete a custom value (location_id, custom_value_id) |
| Method | Path | Description |
| POST | /openai/text | Generate text → {"text"} (prompt, opt system_prompt, model, max_tokens, temperature) |
| POST | /openai/image | Generate image + optionally upload to GHL → {model, openai_url[, file_id, ghl_url]} (prompt, name, opt location_id, model, size, quality, output_format, style, background) |
| Command | Description |
ghl-token | Read OAuth token from DB |
ghl-locations | List location IDs + names from DB |
ghl-location | Full location metadata + token from DB |
ghl-media | Media library operations (list / upload / delete / rename / create-folder) |
runware-generate | Generate an image with Runware and optionally upload it to GHL media library |
ttapi-generate | Generate an image with TTAPI and optionally upload it to GHL media library |
openai-generate text | Generate text with OpenAI (gpt-4o-mini, gpt-4o, …) |
openai-generate image | Generate an image with OpenAI and optionally upload to GHL (gpt-image-1, dall-e-3, dall-e-2) |