# Mock or fail an API endpoint in the iOS Simulator | Lagsmith

> Fail, delay or mock one API endpoint in an iOS Simulator app without a proxy or certificates. Return errors, time-outs or a made-up response while the rest of the app works.

Source: https://lagsmith.com/mock-api-ios-simulator

# Mock or fail one API endpoint in the iOS Simulator

What does your app do when `/login` returns a 503 but everything else works? Lagsmith lets you fail, delay or mock one API endpoint in an iOS Simulator app, with no proxy and no certificates.

[Download for Mac](https://lagsmith.com/download)

## Fail one request, keep the rest

Pick an endpoint from the app’s requests and choose what happens to it:

-   **Offline**: the request fails as if there were no connection.
-   **Time-out**: the request never answers.
-   **HTTP status**: return a 401, 404, 500 or 503.
-   **Delay**: respond, but slowly.
-   **Mock**: return a made-up response, starting from the real one.

## See the result

Lagsmith’s request list shows every request with method, URL, status, timing, headers, bodies, a JSON tree and image previews. Filter with `status:4xx`, `method:POST`, `host:api`, `is:failed` or `-host:cdn`, and export to HAR.

## Why not a proxy?

Proxies such as Charles and Proxyman can rewrite responses too, but need certificates installed to see HTTPS and route all traffic through the proxy. Lagsmith works without either. [vs. Charles](https://lagsmith.com/vs/charles-proxy) · [vs. Proxyman](https://lagsmith.com/vs/proxyman).

## Frequently asked questions

### Do I need a proxy or certificate to mock an endpoint?

No. Lagsmith fails and mocks endpoints in simulator apps without proxy settings or certificates.

### What can I do to one endpoint?

Take it offline, time it out, return an HTTP status, add a delay, or replace the response with a mocked one.

### Can I start the mock from the real response?

Yes. Start from the real response and edit it, so the mock matches your API’s shape.

### Does this work for Mac apps?

Failing and mocking endpoints works for iOS Simulator apps.

## Slow down one app, not your whole Mac

Free to download, with a 14-day Pro trial. No account, no card. Requires macOS 13 Ventura or later.

[Download for Mac](https://lagsmith.com/download) [Compare with Network Link Conditioner](https://lagsmith.com/network-link-conditioner-alternative)
