---
title: "Import codelist items from CSV"
method: POST
path: "/codelists/import_csv/{id}"
tags: ["Codelists"]
---

# Import codelist items from CSV

`POST /codelists/import_csv/{id}`

Requires `codelist:edit`. Replaces all existing items when replace=1 (default). Multipart file field or raw CSV body. dry_run=1 validates without saving.

## Path parameters

- `id` integer, required

## Query parameters

- `dry_run` boolean
- `replace` boolean

## Response `200`

Import result

- object
  - `status` string
  - `dry_run` boolean
  - `codes_imported` integer
  - `codes_count` integer
  - `rows_parsed` integer
  - `warnings` string[]

## Other responses

- `400` — Validation or import failure

## Changes

> 12 revisions in range; 4 could not be searched.

- **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/codelists/import_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)
