Logs

Fetch traffic logs and captured bodies for session assertions.

On this page

Your tests passed — but did the app actually call the right upstream endpoints? Logs have the answer.

GET /sessions/:sessionKey/logs

Traffic logs for a session, newest first by default.

bash
curl "$BASE/sessions/ci-42/logs?project=checkout&environment=staging&limit=50" \
  -H "Authorization: Bearer $KEY"

Query parameters

ParamDefaultNotes
projectRequired for org-wide keys
environmentRequired for multi-endpoint projects
limit501–100
beforeCursor for paging older logs
sinceCursor for polling newer logs (oldest-first)

Use before OR since, not both.

Response (with before)

json
{
  "logs": [
    {
      "id": "log_…",
      "method": "POST",
      "path": "/api/pay",
      "status": 200,
      "durationMs": 142,
      "overrideApplied": false,
      "createdAt": "2026-06-23T12:00:00.000Z"
    }
  ],
  "nextCursor": "log_…"
}

Each log includes method, path, status, duration, whether a mock applied, and preview snippets of the request and response. Full bodies are available via the body endpoint below. FlowMock-internal traffic is excluded from logs.

Response (with since)

json
{
  "logs": [  ],
  "nextCursor": null
}

Returns newer rows since the cursor, oldest-first. Good for polling during a test run.

GET /logs/:logId/body

Fetch the full captured request or response body.

bash
curl "$BASE/logs/log_abc123/body?side=response" \
  -H "Authorization: Bearer $KEY"
ParamValues
siderequest or response

Returns raw JSON (not wrapped in an envelope), max 256 KiB, Content-Type: application/json.

  • 422 invalid_side — bad side value
  • 404 not_found — log or body missing

Project-scoped keys are checked against the log's project.

Example: assert upstream was called

bash
# After your test runs, check logs
curl "$BASE/sessions/ci-42/logs?project=checkout&environment=staging&limit=10" \
  -H "Authorization: Bearer $KEY" | jq '.logs[] | select(.path == "/api/inventory")'

# Fetch the response body for deeper assertions
curl "$BASE/logs/log_xyz/body?side=response" \
  -H "Authorization: Bearer $KEY"