{
  "info": {
    "name": "IDIA Protocol API v1",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Fourteen implemented operations plus explicit sandbox variants, mirrored from Hub 7c30baa8. Feature sandbox returns empty JSON, not SSE or a paid session. Production sessions spend credits. Webhook operations mutate regardless of environment. Source review is not deployed verification."
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://zxyngqciipcvveigrzqt.supabase.co/functions/v1/protocol-api"
    },
    {
      "key": "idiaKey",
      "value": ""
    },
    {
      "key": "environment",
      "value": "sandbox"
    },
    {
      "key": "webhookUrl",
      "value": "https://your-service.example/idia/events"
    },
    {
      "key": "webhookId",
      "value": ""
    },
    {
      "key": "idempotencyKey",
      "value": ""
    },
    {
      "key": "receiptLimit",
      "value": "50"
    },
    {
      "key": "receiptNextCursor",
      "value": ""
    },
    {
      "key": "receiptPrevCursor",
      "value": ""
    },
    {
      "key": "receiptSince",
      "value": ""
    },
    {
      "key": "receiptUntil",
      "value": ""
    },
    {
      "key": "receiptStatus",
      "value": ""
    },
    {
      "key": "featureTopic",
      "value": "vault_health_sync"
    },
    {
      "key": "lastPacketId",
      "value": "0"
    }
  ],
  "item": [
    {
      "name": "Provision status",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/auth/provision-status",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "auth",
            "provision-status"
          ]
        }
      }
    },
    {
      "name": "Validate targets",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{idempotencyKey}}"
          },
          {
            "key": "X-IDIA-Environment",
            "value": "{{environment}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/utility/validate",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "utility",
            "validate"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"target_type\": \"hashed_email\",\n  \"hash_algorithm\": \"sha256\",\n  \"targets\": [\n    \"0000000000000000000000000000000000000000000000000000000000000000\"\n  ]\n}"
        }
      },
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get(\"idempotencyKey\")) {",
              "  pm.collectionVariables.set(\"idempotencyKey\", pm.variables.replaceIn(\"{{$guid}}\"));",
              "}",
              "// Clear idempotencyKey for a new request; keep it unchanged for a retry."
            ]
          }
        }
      ]
    },
    {
      "name": "List receipt history",
      "request": {
        "method": "GET",
        "description": "Read-only Identity Verification key operation. Keep filters fixed across pages. Send once to save cursors, enable one direction query and resend. No automatic traversal. Reset direction queries to start over; sandbox header does not fabricate receipt history.",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/utility/receipts?limit={{receiptLimit}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "utility",
            "receipts"
          ],
          "query": [
            {
              "key": "limit",
              "value": "{{receiptLimit}}",
              "description": "1\u2013100; default 50"
            },
            {
              "key": "starting_after",
              "value": "{{receiptNextCursor}}",
              "disabled": true,
              "description": "Older page; do not enable ending_before simultaneously."
            },
            {
              "key": "ending_before",
              "value": "{{receiptPrevCursor}}",
              "disabled": true,
              "description": "Newer page; do not enable starting_after simultaneously."
            },
            {
              "key": "since",
              "value": "{{receiptSince}}",
              "disabled": true,
              "description": "Inclusive ISO-8601 lower bound."
            },
            {
              "key": "until",
              "value": "{{receiptUntil}}",
              "disabled": true,
              "description": "Exclusive ISO-8601 upper bound."
            },
            {
              "key": "status",
              "value": "{{receiptStatus}}",
              "disabled": true,
              "description": "anchored_l2 or ledger_recorded."
            }
          ]
        }
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (pm.response.code === 200) {",
              "  const page = pm.response.json();",
              "  pm.test(\"Receipt list envelope\", () => {",
              "    pm.expect(page.object).to.eql(\"list\");",
              "    pm.expect(page.order).to.eql(\"timestamp_desc\");",
              "    pm.expect(page.pagination.returned_count).to.eql(page.data.length);",
              "  });",
              "  pm.collectionVariables.set(\"receiptNextCursor\", page.pagination.next_cursor || \"\");",
              "  pm.collectionVariables.set(\"receiptPrevCursor\", page.pagination.prev_cursor || \"\");",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Get receipt",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/utility/receipts/:liability_receipt_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "utility",
            "receipts",
            ":liability_receipt_id"
          ]
        }
      }
    },
    {
      "name": "Vulture ingest",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "X-IDIA-Environment",
            "value": "{{environment}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/vulture/ingest",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "vulture",
            "ingest"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"compliance_framework\": \"standard\",\n  \"payload\": [\n    {\n      \"source_id\": \"node-01\",\n      \"timestamp\": \"2026-11-07T17:33:00Z\"\n    }\n  ]\n}"
        }
      }
    },
    {
      "name": "Vulture verify",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/vulture/verify/:batch_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "vulture",
            "verify",
            ":batch_id"
          ]
        }
      }
    },
    {
      "name": "Billing balance",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/billing/balance",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "billing",
            "balance"
          ]
        }
      }
    },
    {
      "name": "Register webhook",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/webhooks",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "webhooks"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"url\": \"{{webhookUrl}}\",\n  \"events\": [\n    \"receipt.anchored_l2\",\n    \"wallet.credit_depleted\"\n  ],\n  \"credit_threshold\": 10\n}"
        }
      }
    },
    {
      "name": "List webhooks",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/webhooks",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "webhooks"
          ]
        }
      }
    },
    {
      "name": "Disable webhook",
      "request": {
        "method": "DELETE",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/webhooks/{{webhookId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "webhooks",
            "{{webhookId}}"
          ]
        }
      }
    },
    {
      "name": "Test webhook",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/webhooks/test",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "webhooks",
            "test"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"webhook_id\": \"{{webhookId}}\"\n}"
        }
      }
    },
    {
      "name": "Sandbox: Validate targets",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{idempotencyKey}}"
          },
          {
            "key": "X-IDIA-Environment",
            "value": "sandbox"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/utility/validate",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "utility",
            "validate"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"target_type\": \"hashed_email\",\n  \"hash_algorithm\": \"sha256\",\n  \"targets\": [\n    \"0000000000000000000000000000000000000000000000000000000000000000\"\n  ]\n}"
        }
      },
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get(\"idempotencyKey\")) {",
              "  pm.collectionVariables.set(\"idempotencyKey\", pm.variables.replaceIn(\"{{$guid}}\"));",
              "}",
              "// Clear idempotencyKey for a new request; keep it unchanged for a retry."
            ]
          }
        },
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"Zero sandbox debit\", () => { const b = pm.response.json(); pm.expect(b.billing.synapse_credits_deducted).to.eql(0); });",
              "pm.test(\"No sandbox receipts\", () => pm.response.json().results.forEach(r => { pm.expect(r.consent_status).to.eql(\"denied\"); pm.expect(r.liability_receipt_id).to.eql(null); }));"
            ]
          }
        }
      ]
    },
    {
      "name": "Sandbox: Vulture ingest",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "X-IDIA-Environment",
            "value": "sandbox"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/vulture/ingest",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "vulture",
            "ingest"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"compliance_framework\": \"standard\",\n  \"payload\": [\n    {\n      \"source_id\": \"node-01\",\n      \"timestamp\": \"2026-11-07T17:33:00Z\"\n    }\n  ]\n}"
        }
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"Zero sandbox debit\", () => { const b = pm.response.json(); pm.expect(b.billing.synapse_credits_deducted).to.eql(0); });",
              "pm.test(\"No committed sandbox batch\", () => { const b=pm.response.json(); pm.expect(b.batch_id).to.eql(null); pm.expect(b.records_committed).to.eql(0); });"
            ]
          }
        }
      ]
    },
    {
      "name": "Start feature session",
      "request": {
        "method": "POST",
        "description": "Defaults to sandbox JSON; switching environment to production can start a paid session (sessions) or read an existing session (latest/stream). Stream replay is bounded by seven-day packet retention.",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "X-IDIA-Environment",
            "value": "{{environment}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/features/sessions?topic={{featureTopic}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "features",
            "sessions"
          ],
          "query": [
            {
              "key": "topic",
              "value": "{{featureTopic}}"
            }
          ]
        }
      }
    },
    {
      "name": "Latest feature packet",
      "request": {
        "method": "GET",
        "description": "Defaults to sandbox JSON; switching environment to production can start a paid session (sessions) or read an existing session (latest/stream). Stream replay is bounded by seven-day packet retention.",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "X-IDIA-Environment",
            "value": "{{environment}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/features/latest?topic={{featureTopic}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "features",
            "latest"
          ],
          "query": [
            {
              "key": "topic",
              "value": "{{featureTopic}}"
            }
          ]
        }
      }
    },
    {
      "name": "Stream feature packets",
      "request": {
        "method": "GET",
        "description": "Defaults to sandbox JSON; switching environment to production can start a paid session (sessions) or read an existing session (latest/stream). Stream replay is bounded by seven-day packet retention.",
        "header": [
          {
            "key": "x-api-key",
            "value": "{{idiaKey}}"
          },
          {
            "key": "X-IDIA-Environment",
            "value": "{{environment}}"
          },
          {
            "key": "Last-Event-ID",
            "value": "{{lastPacketId}}",
            "disabled": true,
            "description": "Enable deliberately for production replay; decimal ID, not receipt cursor."
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/v1/features/stream?topic={{featureTopic}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "v1",
            "features",
            "stream"
          ],
          "query": [
            {
              "key": "topic",
              "value": "{{featureTopic}}"
            }
          ]
        }
      }
    }
  ]
}
