Skip to content

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 ​

NamespaceWhat lives there
logo-carousel-pro/v1Block editor features: Ready Patterns, favourites, Build with AI, upload de-duplication
lcpro/v1The dashboard's Saved Templates list
sp-lcpro/divi5/v1Divi 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:

js
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:

js
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).

The list of available patterns, as the Ready Patterns Library window shows them.

ParameterTypeDefaultNotes
forcebooleanfalsetrue skips the cached copy and fetches a fresh list. This is what the library's Sync button does.

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)TypeDefaultNotes
idstringrequiredThe pattern ID
slugstring''The pattern's slug. Stored in preference to the ID when sent.
actionstringaddadd 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.

ParameterTypeDefaultNotes
promptstringrequiredWhat you want. An empty prompt returns 400 (lcpro_ai_empty_prompt).
blockNamestringsp-logo-carousel/carouselThe block to build. The prompt can override it while autoRoute is on.
existingAttributesobject{}The block's current attributes, when refining
allowPatternsbooleantrueAllow the answer to be a matching Ready Pattern
autoRoutebooleantrueLet the prompt choose the block (so "a ticker" can become a Marquee). Send false to keep blockName.
providerstring''An AI provider set up under Settings → AI Configuration. Empty uses the saved default.
modelstring''A model for that provider. Empty uses the default.

The response has one of two shapes, told apart by mode:

json
{ "success": true, "mode": "pattern", "blockName": "sp-logo-carousel/marquee", "pattern": { … }, "confidence": 0.9, "reason": "…" }
json
{ "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.

ParameterTypeNotes
hashesarrayrequired. 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.

ParameterTypeNotes
idintegerrequired. 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.

ParameterTypeNotes
idsinteger or arrayrequired

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.

RouteMethodParametersReturns
/sp-lcpro/divi5/v1/saved-templatesGETnoneSaved Templates for the module's picker
/sp-lcpro/divi5/v1/template-htmlGETtemplate_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 ​

ActionLogged-out visitorsWhat it does
update_logo_impressions_batchyesRecords logo impressions for Analytics
update_logo_clickyesRecords logo clicks for Analytics
lcp_pro_load_search_logoyesClassic 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.

ActionUsed for
lcpro_save_optionsSaving Settings, Blocks and Modules
lcpro_activate_license, lcpro_deactivate_license, lcpro_refresh_licenseThe license key
lcpro_ai_verify_keyChecking an AI provider key under AI Configuration
lcpro_analytics_data, lcpro_analytics_logo_trendThe Analytics charts (only while the module is on)
lcpro_block_usageThe Logo Showcase Placements report: where your blocks and views are used
lcpro_changelog_dataThe changelog shown in the dashboard
lcpro_save_user_consentThe optional diagnostic-data choice
lcp_export_shortcodes, lcp_import_shortcodesImport & 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 ​

  • 403 with sp_lcpro_ready_patterns_disabled: the Ready Patterns module or filter is off. Check Logo Carousel → Getting Started → Modules.
  • 403 / rest_forbidden on 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.
  • 404 on /lcpro/v1/templates: the Saved Templates module is off, so the route isn't registered.
  • 404 on a Divi 5 route: Divi isn't active, or its integration switch is off.
  • AI errors: open the response in the Network tab. The message usually names the problem (key rejected, limit reached, timed out).

Next steps ​