REST API Reference

The API is available at http://127.0.0.1:8081/api when the proxy is running. All endpoints are served from the same port as the web UI.

GET /api/requests

Query captured requests. Returns paginated results.

Query parameters match the CLI requests command:

Parameter Description
hostFilter by hostname (substring match)
statusFilter by HTTP status code
methodFilter by HTTP method
content_typeFilter by content type
searchSearch URLs (substring match)
sinceAfter this time (Unix ms or ISO date)
untilBefore this time (Unix ms or ISO date)
limitMaximum number of results (default: 100)
offsetPagination offset
# All requests
curl http://127.0.0.1:8081/api/requests

# Filtered
curl "http://127.0.0.1:8081/api/requests?host=example.com&status=200&limit=50"

Response:

{
  "data": [
    {
      "id": "...",
      "timestamp": 1700000000000,
      "method": "GET",
      ...
    }
  ],
  "total": 142,
  "limit": 100,
  "offset": 0
}

GET /api/requests/:id

Get full details for a single request, including headers and base64-encoded bodies.

curl http://127.0.0.1:8081/api/requests/a1b2c3d4-e5f6-7890-abcd-ef1234567890

DELETE /api/requests

Delete all captured traffic.

curl -X DELETE http://127.0.0.1:8081/api/requests

GET /api/status

Get proxy status.

curl http://127.0.0.1:8081/api/status

Response:

{
  "running": true,
  "proxyPort": 8080,
  "requestCount": 142,
  "dbSizeBytes": 3358720
}

GET /api/ca.crt

Download the RoxyProxy CA certificate. Useful for installing on mobile devices -- open this URL in the device's browser to trigger a certificate install prompt.

curl -O http://127.0.0.1:8081/api/ca.crt

POST /api/proxy/start

Start the proxy server.

curl -X POST http://127.0.0.1:8081/api/proxy/start

POST /api/proxy/stop

Stop the proxy server. The API remains available after stopping the proxy.

curl -X POST http://127.0.0.1:8081/api/proxy/stop

POST /api/replay

Replay a previously captured request.

curl -X POST http://127.0.0.1:8081/api/replay \
  -H "Content-Type: application/json" \
  -d '{"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"}'

GET /api/events

Server-Sent Events stream for real-time updates.

curl -N http://127.0.0.1:8081/api/events

Events are named:

  • event: request -- new captured request (data is the request record as JSON)
  • event: status -- proxy state change (data includes running state and proxy port)

POST /api/shutdown

Shut down the entire process (proxy + API + web UI).

curl -X POST http://127.0.0.1:8081/api/shutdown