How to automate brand color updates across svg libraries via api
- Step 1Define your color swap manifest — Create colors.json: [{ from: '#003082', to: '#1a56db' }, { from: '#e02d3c', to: '#e3342f' }]. This is your complete rebrand color mapping.
- Step 2Call the batch swap API — POST your color manifest and all SVG files to /api/svg/swap-colors. The API returns a ZIP with all updated SVGs and a change-report.json listing every modification.
- Step 3Review the change report and commit — Open change-report.json to verify all replacements. Do a visual regression test (Storybook + Chromatic), then replace the existing SVG files in your codebase and commit.
Frequently asked questions
How do I handle case-insensitive hex color matching?+
The API normalises all hex colors to lowercase before matching. #FF0000, #ff0000, and #Ff0000 are all treated as the same color and matched consistently.
Can the API preserve certain files from the rebrand?+
Yes. Pass an exclude_files array in the request body with filenames to skip. These files are returned unchanged in the output ZIP.
Does the API handle SVG color in CSS style blocks within the SVG?+
Yes. Inline style sheets inside SVG (in style elements) are parsed and their color values are also replaced, not just attribute-level fill and stroke.
What is the rate limit for the color swap API?+
Pro plan: 100 API calls per hour, up to 50 files per call. Developer plan: 500 calls per hour with no file count limit. Rate limit headers are included in every response.
Privacy first
Every JAD SVG tool runs entirely in your browser using the DOM API and Canvas. Your SVG files never leave your device — verified by zero outbound network requests during processing.