{
  "info": {
    "_postman_id": "SB-053-signalfloor-public-api",
    "name": "SignalFloor Public API (v1)",
    "description": "Elite-tier REST API collection. Import into Postman, set the `api_key` collection variable to your `sf_...` or `sf_sandbox_...` key, and run. Sandbox keys return deterministic seed data and are free to mint via the `create_public_api_key_sandbox` RPC — safe for CI integrations.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      { "key": "token", "value": "{{api_key}}", "type": "string" }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://vszujmlwpywubgzfrxbs.supabase.co/functions/v1/public-api",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "sf_sandbox_5b051deadbeefcafe0123456789abcd",
      "type": "string",
      "description": "Replace with your own sf_... (live) or sf_sandbox_... (test) key. The default is a placeholder sandbox prefix — swap it out before running."
    },
    {
      "key": "signal_id",
      "value": "00000000-0000-4000-8000-000000000001",
      "type": "string",
      "description": "Sandbox seed signal id — works against any sandbox key. Replace with a real UUID for live calls."
    },
    {
      "key": "provider_id",
      "value": "00000000-0000-4000-8000-0000000000a1",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Signals",
      "item": [
        {
          "name": "List signals",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v1/signals?limit=10",
              "host": ["{{base_url}}"],
              "path": ["v1", "signals"],
              "query": [
                { "key": "limit", "value": "10" },
                { "key": "asset", "value": "EUR/USD", "disabled": true },
                { "key": "direction", "value": "buy", "disabled": true },
                { "key": "status", "value": "active", "disabled": true },
                { "key": "cursor", "value": "", "disabled": true }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('200 OK', () => pm.response.to.have.status(200));",
                  "pm.test('envelope shape', () => {",
                  "  const b = pm.response.json();",
                  "  pm.expect(b).to.have.property('data');",
                  "  pm.expect(b).to.have.property('pagination');",
                  "  pm.expect(b.data).to.be.an('array');",
                  "});",
                  "pm.test('version header present', () => pm.response.to.have.header('X-API-Version'));"
                ]
              }
            }
          ]
        },
        {
          "name": "Get signal",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v1/signals/{{signal_id}}",
              "host": ["{{base_url}}"],
              "path": ["v1", "signals", "{{signal_id}}"]
            }
          }
        }
      ]
    },
    {
      "name": "Providers",
      "item": [
        {
          "name": "List providers",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v1/providers?sort=performance_score&limit=10",
              "host": ["{{base_url}}"],
              "path": ["v1", "providers"],
              "query": [
                { "key": "sort", "value": "performance_score" },
                { "key": "limit", "value": "10" },
                { "key": "min_trades", "value": "20", "disabled": true },
                { "key": "verified_only", "value": "true", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "Get provider",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v1/providers/{{provider_id}}",
              "host": ["{{base_url}}"],
              "path": ["v1", "providers", "{{provider_id}}"]
            }
          }
        }
      ]
    },
    {
      "name": "Legacy (deprecated)",
      "description": "Un-versioned paths — still respond, but the response carries Deprecation + Sunset: 2026-10-22 headers. Migrate by prepending /v1.",
      "item": [
        {
          "name": "GET /signals (legacy)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/signals?limit=3",
              "host": ["{{base_url}}"],
              "path": ["signals"],
              "query": [{ "key": "limit", "value": "3" }]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Deprecation header present', () => pm.response.to.have.header('Deprecation'));",
                  "pm.test('Sunset header is RFC 8594 date', () => {",
                  "  const s = pm.response.headers.get('Sunset');",
                  "  pm.expect(s).to.match(/GMT$/);",
                  "});"
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}
