---
title: "register a generated CRUD data store"
method: PUT
path: "/mockserver/crud"
tags: ["crud"]
---

# register a generated CRUD data store

`PUT /mockserver/crud`

## Request

- Base URL: `http://localhost:1080`
- URL: `http://localhost:1080/mockserver/crud`
- Auth: none declared

Registers a REST resource backed by an in-memory data store that automatically handles list, read, create, update and delete operations under the supplied base path.

## Request body

- CrudExpectationsDefinition: definition of a generated CRUD data store backed REST resource
  - `basePath` string, required: base path the CRUD resource is served under (e.g. /api/users)
  - `idField` string: name of the field used as the resource identifier
  - `idStrategy` 'AUTO_INCREMENT' | 'UUID': strategy used to generate identifiers for newly created resources
  - `initialData` object[]: initial records to seed the data store with

## Response `201`

CRUD resource registered

- object
  - `basePath` string
  - `idStrategy` string

## Other responses

- `400`: missing basePath or failed to register CRUD resource

---

[API](https://skmtc.dev/mock-server/apis/mockserver-api.md) · [All operations](https://skmtc.dev/mock-server/apis/mockserver-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mock-server/apis/mockserver-api/revisions/9239b693996e?raw)
