Manage mocks from any device
Create a mock at work, then edit, delete, or clear its logs from home or CI using the one-time admin token from the create response.
When to use this
Anyone who knew the slug could edit or delete a mock — fine for a five-minute prototype, risky once a mock lives on. Now every created mock comes back with a one-time admin_token in the create response — save it, because it's never shown again. From then on, editing or deleting the mock, or clearing its logs, needs that token on any device: curl -X PUT https://quickmock.dev/api/mocks/<slug> -H 'Authorization: Bearer qm_...' -d '{...}' — same header for DELETE and for DELETE .../logs. Skip the header and you get 401 admin_token_required; send the wrong token and you get 403 admin_token_invalid. Reading the mock, its logs, and the live inspector still work by slug alone, so anyone you share the URL with can watch it run. Mocks created before this feature keep editing without a token until they expire.
Create the mock
curl -X POST https://quickmock.dev/api/mocks \
-H 'Content-Type: application/json' \
-d '{
"method": "GET",
"response_status": 200,
"content_type": "application/json",
"response_body": "{\"ok\":true}"
}'
Call it
curl https://quickmock.dev/m/<slug>
Open the mock page to watch every incoming request — method, headers, query, and body — land in the live inspector.
What you get
GET /m/<slug> -> 200 {"ok":true} (works from any device, no token)
PUT/DELETE /api/mocks/<slug> and DELETE .../logs need Authorization: Bearer <admin_token>
no header -> 401 admin_token_required
wrong token -> 403 admin_token_invalid