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.
curl "$BASE/sessions/ci-42/logs?project=checkout&environment=staging&limit=50" \
-H "Authorization: Bearer $KEY"Query parameters
| Param | Default | Notes |
|---|---|---|
project | — | Required for org-wide keys |
environment | — | Required for multi-endpoint projects |
limit | 50 | 1–100 |
before | — | Cursor for paging older logs |
since | — | Cursor for polling newer logs (oldest-first) |
Use before OR since, not both.
Response (with before)
{
"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)
{
"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.
curl "$BASE/logs/log_abc123/body?side=response" \
-H "Authorization: Bearer $KEY"| Param | Values |
|---|---|
side | request or response |
Returns raw JSON (not wrapped in an envelope), max 256 KiB, Content-Type: application/json.
422 invalid_side— badsidevalue404 not_found— log or body missing
Project-scoped keys are checked against the log's project.
Example: assert upstream was called
# 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"