Resources

Create Mock REST API Resources | Mock API Studio

Map a route to an exported TypeScript response type, choose collection or single-object behavior, and expose only the REST operations your frontend needs.

Map a route and response

Choose a unique path, source file, exported model, and collection or single-object response shape.

Configuration
Path: /customers
Response: Customer[]
Operations: GET, POST, PATCH, DELETE

Enable REST operations

Collection resources can expose list and item reads plus POST, PUT, PATCH, and DELETE. Disabled methods are not registered by the local server.

Configure resource behavior

Set record counts, pagination limits, sortable fields, and relationship bindings for each resource. Project-level auth, query names, latency, and errors apply consistently.

Call the local resource

Start the CLI and use the printed localhost address from fetch, curl, or an API client.

JavaScript
const response = await fetch("http://localhost:4000/customers");
const payload = await response.json();

Related questions

Can a resource expose only GET?

Yes. Enable only the operations required by the intended contract.

Keep exploring

Last updated September 17, 2026. Product behavior described here is verified against the current Mock API Studio runtime.