{
  "info": {
    "name": "Ludex Ingestion API",
    "description": "Examples for Ludex telemetry ingestion (direct HTTP). Import into Postman or compatible clients.\n\nSet collection variables before sending requests.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "baseUrl", "value": "http://localhost:8000" },
    { "key": "apiKey", "value": "" },
    { "key": "projectId", "value": "" },
    { "key": "environment", "value": "" }
  ],
  "item": [
    {
      "name": "Ingest",
      "item": [
        {
          "name": "Single event",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "type": "text",
                "disabled": true
              },
              {
                "key": "X-Correlation-Id",
                "value": "postman-demo-001",
                "type": "text",
                "disabled": true
              },
              {
                "key": "X-Request-Id",
                "value": "postman-req-001",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"project_id\": \"{{projectId}}\",\n  \"environment\": \"{{environment}}\",\n  \"event\": {\n    \"event_name\": \"level_complete\",\n    \"timestamp\": \"2026-04-13T12:00:00.000Z\",\n    \"player_id\": \"player-demo-1\",\n    \"session_id\": \"session-demo-1\",\n    \"platform\": \"Windows\",\n    \"properties\": {\n      \"level\": 3,\n      \"score\": 1200\n    },\n    \"sdk\": {\n      \"name\": \"postman-collection\",\n      \"version\": \"1.0.0\"\n    },\n    \"event_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n  }\n}"
            },
            "url": "{{baseUrl}}/v1/ingest/event",
            "description": "Requires credential scope `ingest:events`. Expect HTTP 202 with JSON body `status`, `request_id`, `event_id`, `duplicate`."
          },
          "response": []
        },
        {
          "name": "Batch events",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Idempotency-Key",
                "value": "batch-demo-{{$timestamp}}",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"project_id\": \"{{projectId}}\",\n  \"environment\": \"{{environment}}\",\n  \"events\": [\n    {\n      \"event_name\": \"match_started\",\n      \"timestamp\": \"2026-04-13T12:00:01.000Z\",\n      \"session_id\": \"sess-1\",\n      \"properties\": { \"mode\": \"ranked\" }\n    },\n    {\n      \"event_name\": \"match_ended\",\n      \"timestamp\": \"2026-04-13T12:15:00.000Z\",\n      \"session_id\": \"sess-1\",\n      \"properties\": { \"duration_sec\": 900, \"result\": \"win\" }\n    }\n  ]\n}"
            },
            "url": "{{baseUrl}}/v1/ingest/batch",
            "description": "Requires credential scope `ingest:batch`. Max 5000 events per request (default). HTTP 202 with `accepted` or `partial`."
          },
          "response": []
        }
      ]
    }
  ]
}
