REST APIeasy-svg-pro/v1/packs/import

easy-svg-pro/v1/packs/import

Imports an uploaded icon pack ZIP, or a Font Awesome download, as a new icon set.

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

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

Usage

POST /wp-json/easy-svg-pro/v1/packs/import

Example

curl -u admin:app-password -F 'file=@house-icons.zip' https://example.com/wp-json/easy-svg-pro/v1/packs/import

Description

Send the ZIP as multipart field file. Every icon is sanitized and hardened, nothing is written to disk, and the result is stored as a published icon set, so keywords are lost. It never merges into an existing collection: when the slug is taken, the first call stores nothing and answers collision true with a free slug; send that slug again to confirm. With the fontawesome feature on, a Font Awesome download first answers with its styles; send style to import one. Errors: 400 easy_svg_pro_no_file or easy_svg_pro_fa_style, 422 easy_svg_pro_empty_pack, 409 easy_svg_pro_no_slug, 500 easy_svg_pro_set_failed. Permission: Requires manage_options and an active licence. No single feature flag is needed.

Permission: Requires manage_options and an active licence. No single feature flag is needed.

Parameters

body
filefile
Required

Multipart upload: the pack ZIP or a Font Awesome download.

body
slugstring

The collection slug to import under, sent to confirm after a collision.

body
stylestring

For a Font Awesome download: which style to import. One style per collection.

Return value

returnWP_REST_Response|WP_Error

On success slug, label, id, imported, refused, collision, license, author, style and truncated. On a collision without a confirmed slug: collision true, imported 0 and the free slug. For a Font Awesome download without style: fontawesome true, styles and max.

Response

On success slug, label, id, imported, refused, collision, license, author, style and truncated. On a collision without a confirmed slug: collision true, imported 0 and the free slug. For a Font Awesome download without style: fontawesome true, styles and max.

{
  "slug": "house-icons",
  "label": "House icons",
  "id": 57,
  "imported": 24,
  "refused": [],
  "collision": false,
  "license": "CC0-1.0",
  "author": "Your agency",
  "style": null,
  "truncated": false
}