REST APIeasy-svg-pro/v1/presets/install

easy-svg-pro/v1/presets/install

Downloads one preset set from the catalog, checks it and stores it as an icon set.

REST endpoint · Easy SVG Pro · Status: Internal · Defined in includes/presets/presets.php

Internal: not part of the promised public surface. It may change without notice.

Usage

POST /wp-json/easy-svg-pro/v1/presets/install

Example

curl -X POST "https://example.com/wp-json/easy-svg-pro/v1/presets/install" \
	-H "X-WP-Nonce: $NONCE" -b "$COOKIES" \
	-H "Content-Type: application/json" \
	-d '{"slug": "lucide-ui"}'

Description

Only the slug comes from the request; url, size and sha256 are taken from the catalog, so a caller cannot make the site fetch an archive of its choice. The download must match the catalog's size and checksum, the ZIP is read from a temporary file and every icon is sanitized and hardened. A taken slug is moved aside to a free one. Nothing is loaded from another server afterwards.

Permission: manage_options and an active licence with the Preset icon sets feature switched on under Icons, Features.

Parameters

body
slugstring
Required

Which preset set to install, as the catalog names it.

Return value

returnobject

{state, slug, imported, id, label, message}. state is ok on success, otherwise empty_download, too_large, wrong_size, wrong_hash, no_icons, no_sanitizer or no_file, still with HTTP 200. 400 easy_svg_pro_no_preset for an empty slug, 404 for one not in the catalog, 503 when the catalog cannot be read.

Response

{state, slug, imported, id, label, message}. state is ok on success, otherwise empty_download, too_large, wrong_size, wrong_hash, no_icons, no_sanitizer or no_file, still with HTTP 200. 400 easy_svg_pro_no_preset for an empty slug, 404 for one not in the catalog, 503 when the catalog cannot be read.

{
  "state": "ok",
  "slug": "lucide-ui",
  "imported": 120,
  "id": 57,
  "label": "Lucide UI",
  "message": "..."
}
This is the one feature that talks to another server. A failed install still answers 200, so check state.