---
title: "Import components from CSV mapping"
method: POST
path: "/data_structures/import_components_csv/{id}"
tags: ["Data Structures"]
---

# Import components from CSV mapping

`POST /data_structures/import_components_csv/{id}`

Add components to an existing draft data structure using a CSV file and column mapping. Multipart form with `file` (CSV) and `payload` (JSON string), or JSON body with `upload_id` (completed resumable upload) plus mapping fields. Payload shape: `{ delimiter, dry_run?, overwrite?, components: [{ name, label, column_type, csv_column, codelist?: { mode: global|from_csv, ... } }] }`. Codelists created from CSV use maintainable id `CL_{component_name}` under the structure agency.

## Path parameters

- `id` integer, required

## Request body

- object
  - `upload_id` string
  - `delimiter` string
  - `dry_run` boolean
  - `overwrite` boolean
  - `components` object[], required

## Response `200`

Import or dry-run summary

## Other responses

- `400` — Validation failed or bad request

## Changes

- **2026-05-24** `b93c122bc338` — 1 info
  - endpoint added
- **2026-02-23** `5bfc4d9dc1c8` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/worldbank/apis/metadata-editor-api/changes/data_structures/import_components_csv/:id/post.md)

---

[API](https://skmtc.dev/worldbank/apis/metadata-editor-api.md) · [All operations](https://skmtc.dev/worldbank/apis/metadata-editor-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/worldbank/metadata-editor-api/revisions/f4c8258bab5a/schema)
