API Documentation

Move data in and out seamlessly

Bulk CSV import with preview and validation before persisting. Export to JSON or CSV with dimension-aware scope flattening for clean, channel-ready data files.

CSV Import

Upload rows mapped to schema attributes. Preview validates every row before committing — catch errors before they persist.

Scope Flattening

Export with a scope parameter to flatten dimension-scoped values into simple columns. Perfect for language-specific CSV feeds.

Column Mapping

Map CSV column headers to attribute aliases via columnMapping. Use "_id" to target existing records for updates.

Dual Formats

Export as application/json for API consumers or text/csv with Content-Disposition for direct file downloads.

Endpoints

Method Path Description
POST /import/preview Preview import — validate rows without persisting
POST /import/execute Execute import — create or update records
GET /export Export records as JSON or CSV

POST   /import/preview

Validate import data without persisting any records. Returns per-row validation results so you can review and fix errors before executing the actual import.

Request Body

FieldTypeDescription
rows Record<string, string>[] Array of row objects. Each key is a CSV column name, each value is the cell string.
schemaId string The schema ID to import records into.
columnMapping Record<string, string> Maps CSV column names to attribute aliases. Use "_id" as the target to match existing records for updates.

Example — Preview a CSV import

curl -X POST https://api.sigma-pim.com/api/v1/import/preview \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \ -H "Content-Type: application/json" \ -d '{ "schemaId": "schema-apparel", "columnMapping": { "Name": "product-name", "SKU": "sku", "Price": "price" }, "rows": [ { "Name": "Coastal Windbreaker", "SKU": "CW-001", "Price": "129.99" }, { "Name": "Summit Parka", "SKU": "SP-002", "Price": "249.50" }, { "Name": "", "SKU": "XX-003", "Price": "not-a-number" } ] }'
// Response { "valid": false, "totalRows": 3, "validRows": 2, "invalidRows": 1, "results": [ { "row": 0, "valid": true, "errors": [] }, { "row": 1, "valid": true, "errors": [] }, { "row": 2, "valid": false, "errors": [ "product-name: required attribute is missing", "price: expected a number value" ] } ] }

POST   /import/execute

Execute the import, creating new records or updating existing ones. Accepts the same request body as /import/preview. When a row's columnMapping includes "_id", the importer matches existing records by ID and updates them instead of creating duplicates.

Request Body

Same schema as POST /import/previewrows, schemaId, and columnMapping.

Example — Execute a CSV import

curl -X POST https://api.sigma-pim.com/api/v1/import/execute \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \ -H "Content-Type: application/json" \ -d '{ "schemaId": "schema-apparel", "columnMapping": { "Name": "product-name", "SKU": "sku", "Price": "price" }, "rows": [ { "Name": "Coastal Windbreaker", "SKU": "CW-001", "Price": "129.99" }, { "Name": "Summit Parka", "SKU": "SP-002", "Price": "249.50" } ] }'
// Response { "created": 2, "updated": 0, "errors": [] }

Example — Update existing records by ID

curl -X POST https://api.sigma-pim.com/api/v1/import/execute \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \ -H "Content-Type: application/json" \ -d '{ "schemaId": "schema-apparel", "columnMapping": { "ID": "_id", "Price": "price" }, "rows": [ { "ID": "ent-abc123", "Price": "139.99" }, { "ID": "ent-def456", "Price": "259.00" } ] }'
// Response { "created": 0, "updated": 2, "errors": [] }

GET   /export

Export records as JSON or CSV. When exporting as CSV with a scope parameter, dimension-scoped attribute values are flattened into simple columns — perfect for generating language- or market-specific product feeds.

Query Parameters

ParameterTypeDefaultDescription
format "json" | "csv" "json" Output format. CSV responses include Content-Disposition: attachment.
schemaId string Filter to records belonging to this schema.
scope string JSON-encoded DimensionScope object for CSV flattening. Example: {"dim-language":"seg-en"}

Example — Export as JSON

curl https://api.sigma-pim.com/api/v1/export \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
// Response — Content-Type: application/json [ { "id": "ent-abc123", "schemaId": "schema-apparel", "values": { "product-name": [ { "scope": {}, "value": "Coastal Windbreaker" }, { "scope": { "dim-language": "seg-da" }, "value": "Kyst Vindjakke" } ], "sku": [{ "scope": {}, "value": "CW-001" }], "price": [{ "scope": {}, "value": 129.99 }] } } ]

Example — Export as CSV with English scope flattening

curl "https://api.sigma-pim.com/api/v1/export?format=csv&schemaId=schema-apparel&scope=%7B%22dim-language%22%3A%22seg-en%22%7D" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
# Response — Content-Type: text/csv # Content-Disposition: attachment; filename="export.csv" id,product-name,sku,price ent-abc123,Coastal Windbreaker,CW-001,129.99 ent-def456,Summit Parka,SP-002,249.50 ent-ghi789,Alpine Fleece,AF-003,89.00

When scope is provided, the exporter resolves each scoped attribute to a single value matching the given dimension segments. This turns multi-scope JSON arrays into flat CSV columns.