admin-catalog-tools

Save an extracted component to the catalog

Creates a components record (always preferred_suggestion: false; null and empty fields are dropped). brand is a brand name that is matched or created in component_brands. An icon data URI is uploaded as a <slugified-name>.png file; any other icon string is stored as-is. Each affiliate_links entry becomes an affiliate_links record. Brand and per-link failures do not fail the request; they are reported in warnings. The route performs no input validation of its own, so invalid input surfaces as 500.

post/api/admin/save-component

Request

  • Base URL: https://voltplan.app
  • URL: https://voltplan.app/api/admin/save-component
  • Auth: HTTP bearer

Request body

namestring required
type'battery' | 'charger' | 'inverter' | 'transformer' | 'power' | 'load' | 'fuse' | 'shunt' | 'switch' | 'disconnect' | 'tool' required
voltage_innumber nullable
voltage_in_type'ac' | 'dc' | 'null' nullable
voltage_outnumber nullable
voltage_out_type'ac' | 'dc' | 'null' nullable
wattnumber nullable
estd_price_euronumber nullable
descriptionstring nullable
imagestring nullable
iconstring nullable

A data URI is uploaded as a PNG file; any other string is stored as-is.

duty_cyclenumber nullable
default_utilization_factornumber nullable
usage_hours_per_daynumber nullable
amperagenumber nullable
cutoff_voltagenumber nullable
fuse_typestring nullable
wire_gaugestring nullable
brandstring nullable

Brand name, matched or created in component_brands.

Response

Component created.

successunknown required
componentIdstring required

Id of the new components record.

message'Component saved successfully' required
warningsstring[]

Non-fatal problems (brand or affiliate-link creation failed). Omitted when empty.

Changes

No recorded changes to this operation across all 1 revision of this API.