# Mock from CSV/JSON

> Paste a collection of records, get a stateful REST API.

Mock from CSV/JSON turns a JSON array or CSV file into a live REST API with working create, read, update and delete endpoints, where data you write persists between calls.

Also: crud api generator, mock from csv, mock from json, create rest api from json, json to rest api, fake crud api, mock crud api, csv to rest api, stateful mock api, rest api from data, generate api from json, json server alternative.

## What it does

Paste a list of records and one click gives you a public URL serving five endpoints for that resource. Unlike a static mock, this one holds state: POST a record and the next GET returns it, PUT changes it, DELETE removes it. Your rows are stored as a Postman Dataset, and the mock reads and writes that dataset with SQL on every request — so the data you see through the API is the same data sitting in your workspace. It runs for as long as you need it, and it needs no account to create.

## When to use it

- Build a frontend against a real API before the backend exists.
- Give a mobile or web client something stateful to integrate with during a demo.
- Reproduce a bug that only shows up after a write, without touching production.
- Teach or learn REST semantics against endpoints that actually change.
- Replace a locally-run json-server with a URL a teammate can also reach.

## What you give it

| Input | Meaning |
| --- | --- |
| A JSON array or CSV | A list of records sharing a shape, for example [{ "id": 1, "name": "Mouse" }]. CSV needs a header row. Up to 500 records and 100 KB. |
| A resource name | The path segment the records are served under, for example products, giving /products and /products/{id}. |

## What you get back

| Output | Meaning |
| --- | --- |
| A live API URL | A public HTTPS address serving your data. No key, no header, callable from anything. |
| Five CRUD endpoints | GET the collection, GET one record, POST a new one, PUT a replacement, DELETE. Plus a /health endpoint reporting the current record count. |
| Persistent state | Writes go to the dataset, so the API behaves like a real one rather than replaying a fixed response. |
| Request logs | Every call the mock served, with method, path, status and duration. |
| A Postman Dataset | The store behind the API, saved in a workspace so both the data and the mock are still there after you sign up. |

## Key terms

- **CRUD** — create, read, update, delete — the four operations most REST resources expose, mapped here to POST, GET, PUT and DELETE.
- **stateful mock** — a mock API that remembers what you wrote to it, so a POST changes what a later GET returns. A stateless mock replays the same response every time.
- **dataset** — a queryable table in your Postman workspace. This tool creates one from your records and points the mock at it, so the API and the workspace share one source of truth.
- **collection of data** — a list of records sharing a shape. It is what a REST resource is made of, and why a single object or a list of numbers cannot be turned into one.

## Questions

### What data formats are supported?

A JSON array of objects, or CSV with a header row. Either way it has to be a list of records — a single object or a list of plain values cannot be addressed as /resource/{id}, so the tool asks you to wrap it in an array instead.

### Is the data really stateful?

Yes. Every request runs SQL against a Postman Dataset — a SELECT for a read, an INSERT, UPDATE or DELETE for a write. Nothing is held in your browser, so a POST from one machine is visible to a GET from another.

### What if my records have no id?

One is added for you, numbered from 1, and the tool tells you which field it used. If your records already carry an id, _id, uuid or a resource-named id field such as orderId, that one is used instead.

### Does PUT replace or merge?

It replaces, which is what PUT means in REST. Fields you leave out of the body are removed; only the id is carried over, and it is taken from the URL rather than the body, so a record cannot be moved by editing it.

### Can anyone else change my data?

Yes — the URL is public and unauthenticated, and everyone calling it shares one set of records. That is deliberate, so you can hand the URL to a teammate or point a deployed frontend at it. Do not put anything private in it.

### How long does the API stay up?

It keeps running. Sign up to keep it in your workspace along with the Dataset holding your original rows, and to edit the handler, add scenarios or make it private.


## Privacy

The data you paste is stored as a Postman Dataset and served from a public, unauthenticated URL that anyone with the link can read and write — so treat it as public. Nothing is shared with third parties, and no account is needed. Paste sample or synthetic data rather than anything real.

## Links

- [Use the tool](https://www.postman.com/tools/mock-from-csv-json) — the interactive version of this page.
- [Postman Tools](https://www.postman.com/tools) — every free tool in this set.
- [Mock Servers docs](https://learning.postman.com/docs/design-apis/mock-servers/overview/) — Postman documentation.
