---
title: "Replace existing data file"
method: POST
path: "/data/replace_datafile/{sid}/{file_id}"
tags: ["Microdata"]
---

# Replace existing data file

`POST /data/replace_datafile/{sid}/{file_id}`

Replace an existing microdata data file with a new version. The system will automatically detect variable changes (added, removed, updated).

## Path parameters

- `sid` string, required
- `file_id` string, required

## Response `200`

Data file replaced successfully

- object
  - `status` string
  - `message` string
  - `result` object

## Other responses

- `400` — Bad request - project not found, data file not found, or replacement failed

---

[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)
