{
    "info": {
        "_postman_id": "b2e1f4a6-7c83-4e1d-9a2b-5f6c7d8e9a01",
        "name": "Winnow API (Licrat)",
        "description": "Winnow scores survey responses for quality and fraud. Base URL is in the {{baseUrl}} variable. Bearer auth: put your token in the {{apiKey}} variable (the default TU_API_KEY is a PLACEHOLDER — never commit a real key).",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "variable": [
        {
            "key": "baseUrl",
            "value": "https://api.licrat.com",
            "type": "string"
        },
        {
            "key": "apiKey",
            "value": "TU_API_KEY",
            "type": "string"
        }
    ],
    "item": [
        {
            "name": "Health check (abierto)",
            "request": {
                "method": "GET",
                "header": [],
                "url": {
                    "raw": "{{baseUrl}}/health",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "health"
                    ]
                },
                "description": "Liveness check. Returns {\"status\":\"ok\"}. No authentication required."
            }
        },
        {
            "name": "Score response",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    },
                    {
                        "key": "Authorization",
                        "value": "Bearer {{apiKey}}"
                    }
                ],
                "body": {
                    "mode": "raw",
                    "raw": "{\n  \"response_id\": \"resp_demo_001\",\n  \"duration_seconds\": 240,\n  \"fingerprint\": \"a1b2c3d4hashed\",\n  \"survey\": {\n    \"total_questions\": 5,\n    \"min_expected_seconds\": 60,\n    \"attention_checks\": [\n      {\n        \"question_id\": \"q_attn\",\n        \"expected_value\": 3\n      }\n    ],\n    \"grids\": [\n      [\n        \"q3a\",\n        \"q3b\",\n        \"q3c\"\n      ]\n    ]\n  },\n  \"answers\": [\n    {\n      \"question_id\": \"q1\",\n      \"type\": \"single\",\n      \"value\": \"Yes\",\n      \"seconds_spent\": 12\n    },\n    {\n      \"question_id\": \"q2\",\n      \"type\": \"scale\",\n      \"value\": 4,\n      \"seconds_spent\": 8\n    },\n    {\n      \"question_id\": \"q3a\",\n      \"type\": \"grid\",\n      \"value\": 5,\n      \"seconds_spent\": 5\n    },\n    {\n      \"question_id\": \"q3b\",\n      \"type\": \"grid\",\n      \"value\": 3,\n      \"seconds_spent\": 4\n    },\n    {\n      \"question_id\": \"q3c\",\n      \"type\": \"grid\",\n      \"value\": 4,\n      \"seconds_spent\": 4\n    },\n    {\n      \"question_id\": \"q_attn\",\n      \"type\": \"single\",\n      \"value\": 3,\n      \"seconds_spent\": 6\n    },\n    {\n      \"question_id\": \"q5\",\n      \"type\": \"open_text\",\n      \"value\": \"Useful and easy to use.\",\n      \"seconds_spent\": 30\n    }\n  ]\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                },
                "url": {
                    "raw": "{{baseUrl}}/v1/score",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "v1",
                        "score"
                    ]
                },
                "description": "Score a single survey response. Valid example body per the ScoreRequest schema in openapi.yaml."
            }
        },
        {
            "name": "Score batch",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    },
                    {
                        "key": "Authorization",
                        "value": "Bearer {{apiKey}}"
                    }
                ],
                "body": {
                    "mode": "raw",
                    "raw": "{\n  \"responses\": [\n    {\n      \"response_id\": \"resp_clean_A\",\n      \"duration_seconds\": 240,\n      \"fingerprint\": \"shared-fp-xyz\",\n      \"survey\": {\n        \"total_questions\": 5,\n        \"min_expected_seconds\": 60,\n        \"attention_checks\": [\n          {\n            \"question_id\": \"q_attn\",\n            \"expected_value\": 3\n          }\n        ],\n        \"grids\": [\n          [\n            \"q3a\",\n            \"q3b\",\n            \"q3c\"\n          ]\n        ]\n      },\n      \"answers\": [\n        {\n          \"question_id\": \"q1\",\n          \"type\": \"single\",\n          \"value\": \"Yes\",\n          \"seconds_spent\": 12\n        },\n        {\n          \"question_id\": \"q2\",\n          \"type\": \"scale\",\n          \"value\": 4,\n          \"seconds_spent\": 9\n        },\n        {\n          \"question_id\": \"q3a\",\n          \"type\": \"grid\",\n          \"value\": 5,\n          \"seconds_spent\": 6\n        },\n        {\n          \"question_id\": \"q3b\",\n          \"type\": \"grid\",\n          \"value\": 3,\n          \"seconds_spent\": 7\n        },\n        {\n          \"question_id\": \"q3c\",\n          \"type\": \"grid\",\n          \"value\": 4,\n          \"seconds_spent\": 5\n        },\n        {\n          \"question_id\": \"q_attn\",\n          \"type\": \"single\",\n          \"value\": 3,\n          \"seconds_spent\": 8\n        },\n        {\n          \"question_id\": \"q5\",\n          \"type\": \"open_text\",\n          \"value\": \"The checkout flow felt smooth and clear.\",\n          \"seconds_spent\": 35\n        }\n      ]\n    },\n    {\n      \"response_id\": \"resp_fraud_B\",\n      \"duration_seconds\": 5,\n      \"fingerprint\": \"shared-fp-xyz\",\n      \"survey\": {\n        \"total_questions\": 5,\n        \"min_expected_seconds\": 60,\n        \"attention_checks\": [\n          {\n            \"question_id\": \"q_attn\",\n            \"expected_value\": 3\n          }\n        ],\n        \"grids\": [\n          [\n            \"q3a\",\n            \"q3b\",\n            \"q3c\"\n          ]\n        ]\n      },\n      \"answers\": [\n        {\n          \"question_id\": \"q3a\",\n          \"type\": \"grid\",\n          \"value\": 1,\n          \"seconds_spent\": 1\n        },\n        {\n          \"question_id\": \"q3b\",\n          \"type\": \"grid\",\n          \"value\": 1,\n          \"seconds_spent\": 1\n        },\n        {\n          \"question_id\": \"q3c\",\n          \"type\": \"grid\",\n          \"value\": 1,\n          \"seconds_spent\": 1\n        },\n        {\n          \"question_id\": \"q_attn\",\n          \"type\": \"single\",\n          \"value\": 1,\n          \"seconds_spent\": 1\n        },\n        {\n          \"question_id\": \"q5\",\n          \"type\": \"open_text\",\n          \"value\": \"asdfgh jkl\",\n          \"seconds_spent\": 1\n        }\n      ]\n    }\n  ]\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                },
                "url": {
                    "raw": "{{baseUrl}}/v1/score/batch",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "v1",
                        "score",
                        "batch"
                    ]
                },
                "description": "Score many responses at once. A is clean; B shares A's fingerprint (duplicate) and is built to trip every per-response flag: duration below min_expected_seconds (speeding), identical grid answers (straight_lining), wrong attention-check value (attention_check_failed), an \"asdfgh jkl\" open_text (gibberish_open_text) and identical seconds_spent (uniform_timing)."
            }
        },
        {
            "name": "Report batch (aggregate)",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    },
                    {
                        "key": "Authorization",
                        "value": "Bearer {{apiKey}}"
                    }
                ],
                "body": {
                    "mode": "raw",
                    "raw": "{\n  \"responses\": [\n    {\n      \"response_id\": \"resp_clean_A\",\n      \"duration_seconds\": 240,\n      \"fingerprint\": \"fp-aaa\",\n      \"survey\": { \"min_expected_seconds\": 60 },\n      \"answers\": []\n    },\n    {\n      \"response_id\": \"resp_speed_B\",\n      \"duration_seconds\": 5,\n      \"fingerprint\": \"fp-bbb\",\n      \"survey\": { \"min_expected_seconds\": 60 },\n      \"answers\": []\n    },\n    {\n      \"response_id\": \"resp_dup_C\",\n      \"duration_seconds\": 240,\n      \"fingerprint\": \"fp-aaa\",\n      \"survey\": { \"min_expected_seconds\": 60 },\n      \"answers\": []\n    }\n  ]\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                },
                "url": {
                    "raw": "{{baseUrl}}/v1/report",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "v1",
                        "report"
                    ]
                },
                "description": "Same input contract as /v1/score/batch, but returns an AGGREGATE report only (no per-response scores): total_responses, summary (mean/median/grade/note), recommendations with count+pct, estimated_clean_n, a fixed 10-bin score_distribution and flag_frequency. Here A is clean, B is a speeder (duration below min_expected_seconds) and C duplicates A's fingerprint."
            }
        },
        {
            "name": "Score with field mapping",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    },
                    {
                        "key": "Authorization",
                        "value": "Bearer {{apiKey}}"
                    }
                ],
                "body": {
                    "mode": "raw",
                    "raw": "{\n  \"resp_id\": \"resp_mapped_001\",\n  \"meta\": {\n    \"time_taken\": 180\n  },\n  \"fp\": \"a1b2c3d4hashed\",\n  \"mapping\": {\n    \"response_id\": \"resp_id\",\n    \"duration_seconds\": \"meta.time_taken\",\n    \"fingerprint\": \"fp\"\n  },\n  \"survey\": {\n    \"total_questions\": 3,\n    \"min_expected_seconds\": 60,\n    \"attention_checks\": [\n      {\n        \"question_id\": \"q_attn\",\n        \"expected_value\": 3\n      }\n    ],\n    \"grids\": [\n      [\n        \"q2a\",\n        \"q2b\"\n      ]\n    ]\n  },\n  \"answers\": [\n    {\n      \"question_id\": \"q1\",\n      \"type\": \"single\",\n      \"value\": \"No\",\n      \"seconds_spent\": 20\n    },\n    {\n      \"question_id\": \"q2a\",\n      \"type\": \"grid\",\n      \"value\": 4,\n      \"seconds_spent\": 15\n    },\n    {\n      \"question_id\": \"q2b\",\n      \"type\": \"grid\",\n      \"value\": 2,\n      \"seconds_spent\": 14\n    },\n    {\n      \"question_id\": \"q_attn\",\n      \"type\": \"single\",\n      \"value\": 3,\n      \"seconds_spent\": 18\n    }\n  ]\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                },
                "url": {
                    "raw": "{{baseUrl}}/v1/score",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "v1",
                        "score"
                    ]
                },
                "description": "Same endpoint, but the body uses non-canonical client field names (resp_id, meta.time_taken, fp) plus a \"mapping\" object that translates them to Winnow's canonical fields before scoring. survey and answers stay canonical."
            }
        }
    ]
}
