REST API and AJAX Reference
The HTTP endpoints Logo Carousel registers: what powers the editor's patterns and AI builder, the dashboard, and the page-builder integrations.
You don't need this page to use the plugin. It's here for two situations: you're debugging something (the pattern library won't load, Build with AI returns an error) and want to see the real request, or you're building on top of the plugin and want to know what's there.
Internal endpoints, not a public API
These exist to serve the plugin's own editor, dashboard and front end. Names, parameters and responses can change in any release. They're fine to call for debugging or a controlled internal integration; don't build a public product on them.
First, what doesn't use the network
Worth knowing before you go looking for a request in the browser's Network tab: the blocks' Ajax Live Filter, Ajax Search and Pagination run entirely in the browser. The server prints every logo, and the page shows or hides them as visitors filter, search or page. No request is made, despite the "Ajax" names. If one of these misbehaves, the cause is in the page (a script conflict, a caching plugin combining scripts), not on the server. See Ajax Live Filter and Pagination.
The only front-end requests the blocks make are the analytics beacons described under AJAX actions.
Namespaces at a glance
| Namespace | What lives there |
|---|---|
logo-carousel-pro/v1 | Block editor features: Ready Patterns, favourites, Build with AI, upload de-duplication |
lcpro/v1 | The dashboard's Saved Templates list |
sp-lcpro/divi5/v1 | Divi 5 Visual Builder previews, registered only when Divi is present and its integration is on |
The base URL is your site's REST root, normally https://example.com/wp-json/.
Authentication
Every route needs a logged-in user with the right capability. From the browser, send WordPress's REST nonce so your session is recognised:
fetch( '/wp-json/logo-carousel-pro/v1/patterns', {
headers: { 'X-WP-Nonce': wpApiSettings.nonce },
} );Inside the block editor, @wordpress/api-fetch adds the nonce for you:
import apiFetch from '@wordpress/api-fetch';
const patterns = await apiFetch( { path: '/logo-carousel-pro/v1/patterns' } );From outside WordPress (a script, a CI job), use an Application Password with basic auth.
Ready Patterns
These routes answer only while the Ready Patterns library is on, meaning the Ready Patterns Library module is enabled on Logo Carousel → Getting Started → Modules and the sp_lcpro_ready_patterns_enabled filter hasn't turned it off. Otherwise they return 403 with the code sp_lcpro_ready_patterns_disabled, whoever is asking.
Requires edit_posts (Contributor and up).
GET /logo-carousel-pro/v1/patterns
The list of available patterns, as the Ready Patterns Library window shows them.
| Parameter | Type | Default | Notes |
|---|---|---|---|
force | boolean | false | true skips the cached copy and fetches a fresh list. This is what the library's Sync button does. |
GET /logo-carousel-pro/v1/patterns/<id>
One pattern's block markup, fetched when you insert it rather than up front. id is letters, numbers, underscores and hyphens. Returns { "content": "<!-- wp:sp-logo-carousel/… -->" }, or 404 (sp_lcpro_pattern_not_found) when the pattern can't be found.
GET / POST /logo-carousel-pro/v1/pattern-favorites
The current user's favourite patterns, stored per user.
- GET returns
{ "favorites": [ … ] }. - POST adds or removes one and returns the updated list.
| Parameter (POST) | Type | Default | Notes |
|---|---|---|---|
id | string | required | The pattern ID |
slug | string | '' | The pattern's slug. Stored in preference to the ID when sent. |
action | string | add | add or remove |
Build with AI
POST /logo-carousel-pro/v1/ai-generate
Turns a written request into a block. This is what Build Logo Showcase and Update with AI call in the AI Builder.
Requires edit_posts, and the AI builder must be available: the Build with AI module on, the lcpro_ai_builder_enabled filter not returning false, and WordPress not reporting AI as disabled on the site. Otherwise it returns an error explaining which.
| Parameter | Type | Default | Notes |
|---|---|---|---|
prompt | string | required | What you want. An empty prompt returns 400 (lcpro_ai_empty_prompt). |
blockName | string | sp-logo-carousel/carousel | The block to build. The prompt can override it while autoRoute is on. |
existingAttributes | object | {} | The block's current attributes, when refining |
allowPatterns | boolean | true | Allow the answer to be a matching Ready Pattern |
autoRoute | boolean | true | Let the prompt choose the block (so "a ticker" can become a Marquee). Send false to keep blockName. |
provider | string | '' | An AI provider set up under Settings → AI Configuration. Empty uses the saved default. |
model | string | '' | A model for that provider. Empty uses the default. |
The response has one of two shapes, told apart by mode:
{ "success": true, "mode": "pattern", "blockName": "sp-logo-carousel/marquee", "pattern": { … }, "confidence": 0.9, "reason": "…" }{ "success": true, "mode": "attributes", "blockName": "sp-logo-carousel/grid", "attributes": { … }, "patternDeclineReason": "" }Provider errors (bad key, rate limit, timeout) come back as standard REST errors with a message you can show to the user. See Troubleshooting.
Logo uploads
POST /logo-carousel-pro/v1/logo-upload-reuse
Before uploading, the editor fingerprints each file and asks this route whether the Media Library already has it. Matches are reused instead of uploaded again, which is why you see "This image already exists, so we reused the existing logo instead of creating a duplicate."
Requires upload_files and a nonce made for sp_lcpro_logo_upload_reuse, sent in the nonce parameter. The editor provides both; this route isn't meant to be called on its own.
| Parameter | Type | Notes |
|---|---|---|
hashes | array | required. SHA-256 fingerprints of the files about to be uploaded. |
Saved Templates
Registered only while the Saved Templates module is on. Requires the plugin's admin capability: manage_options by default, changeable with the sp_lc_ui_permission filter.
GET /lcpro/v1/templates
Lists up to 200 Saved Templates, newest first, in any status (published, draft, pending, private, scheduled). Each entry has id, title, status, date, dateDisplay, shortcode (for example [lc_template id="12"]), editUrl, and blockTypes / blockLabel naming the Logo Carousel blocks the template contains.
POST /lcpro/v1/templates/duplicate
Copies a template as a new draft and returns the new entry.
| Parameter | Type | Notes |
|---|---|---|
id | integer | required. The template to copy. |
POST /lcpro/v1/templates/delete
Moves templates to the trash. Templates the user isn't allowed to delete are skipped. Returns { "deleted": [ … ] } with the IDs that were trashed.
| Parameter | Type | Notes |
|---|---|---|
ids | integer or array | required |
Divi 5
Registered only when Divi is installed and the Divi switch is on under Settings → Integrations. Used by the Divi integration inside the Visual Builder. Requires edit_posts.
| Route | Method | Parameters | Returns |
|---|---|---|---|
/sp-lcpro/divi5/v1/saved-templates | GET | none | Saved Templates for the module's picker |
/sp-lcpro/divi5/v1/template-html | GET | template_id (integer, required) | The rendered HTML of one template, for the builder preview |
AJAX actions
Some features use WordPress's older admin-ajax.php endpoint instead of REST. You call them with a POST to /wp-admin/admin-ajax.php and an action field.
Front end
| Action | Logged-out visitors | What it does |
|---|---|---|
update_logo_impressions_batch | yes | Records logo impressions for Analytics |
update_logo_click | yes | Records logo clicks for Analytics |
lcp_pro_load_search_logo | yes | Classic views only: returns logos for the classic Ajax search, live filter and pagination |
All three check a nonce made for lcp-modal (sent as security for the analytics actions). The page receives it automatically, in window.spLcproAnalytics for blocks and in lcp_vars for classic views. Analytics requests are only sent while the Analytics module is on and logo tracking is switched on in its settings.
Dashboard
The React dashboard under Logo Carousel uses these. Each requires a dashboard nonce and the plugin's admin capability, so they only work from the dashboard itself.
| Action | Used for |
|---|---|
lcpro_save_options | Saving Settings, Blocks and Modules |
lcpro_activate_license, lcpro_deactivate_license, lcpro_refresh_license | The license key |
lcpro_ai_verify_key | Checking an AI provider key under AI Configuration |
lcpro_analytics_data, lcpro_analytics_logo_trend | The Analytics charts (only while the module is on) |
lcpro_block_usage | The Logo Showcase Placements report: where your blocks and views are used |
lcpro_changelog_data | The changelog shown in the dashboard |
lcpro_save_user_consent | The optional diagnostic-data choice |
lcp_export_shortcodes, lcp_import_shortcodes | Import & Export |
The classic screens also use the bundled options framework's own save actions and a live-preview action for views.
WordPress core endpoints
The classic logo post type isn't exposed in the REST API, so /wp/v2/ has no logo route. Block logos are ordinary Media Library images: the editor reads and updates them through core's /wp/v2/media/<id>, which is why editing a logo's title or alt text in the Edit Logo Image window also updates the image in the Media Library.
Debugging checklist
403withsp_lcpro_ready_patterns_disabled: the Ready Patterns module or filter is off. Check Logo Carousel → Getting Started → Modules.403/rest_forbiddenon every route: you're not logged in, the nonce is missing or stale, or the user lacks the capability. Reload the editor to refresh the nonce.404on/lcpro/v1/templates: the Saved Templates module is off, so the route isn't registered.404on a Divi 5 route: Divi isn't active, or its integration switch is off.- AI errors: open the response in the Network tab. The
messageusually names the problem (key rejected, limit reached, timed out).
Next steps
- Hooks: Actions and Filters: including the switches that turn these features off.
- Shortcodes and Block Attributes: the data these endpoints produce.
- Troubleshooting: symptoms and fixes.