{
  "info": {
    "name": "Athena API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Auto-generated Postman collection for all registered Athena RS routes."
  },
  "variable": [
    { "key": "baseUrl", "value": "http://localhost:4052", "type": "string" },
    { "key": "X_User_Id", "value": "", "type": "string" },
    { "key": "X_Company_Id", "value": "", "type": "string" },
    { "key": "X_Organization_Id", "value": "", "type": "string" },
    { "key": "X_Athena_Client", "value": "supabase", "type": "string" },
    { "key": "X_Strip_Nulls", "value": "false", "type": "string" },
    { "key": "X_Publish_Event", "value": "false", "type": "string" },
    { "key": "apikey", "value": "", "type": "string" },
    { "key": "api_registry_id", "value": "", "type": "string" },
    { "key": "scylla_table_name", "value": "users", "type": "string" },
    { "key": "x_supabase_url", "value": "", "type": "string" },
    { "key": "x_supabase_key", "value": "", "type": "string" },
    { "key": "SUPABASE_ACCESS_TOKEN", "value": "", "type": "string" },
    { "key": "PROJECT_REF", "value": "", "type": "string" }
  ],
  "item": [
    {
      "name": "Health",
      "item": [
        {
          "name": "GET /",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" }
            ],
            "url": "{{baseUrl}}/"
          }
        }
      ]
    },
    {
      "name": "Scylla",
      "item": [
        {
          "name": "GET /scylla",
          "request": {
            "method": "GET",
            "header": [ { "key": "Accept", "value": "application/json" } ],
            "url": "{{baseUrl}}/scylla"
          }
        },
        {
          "name": "GET /scylla/tables",
          "request": {
            "method": "GET",
            "header": [ { "key": "Accept", "value": "application/json" } ],
            "url": "{{baseUrl}}/scylla/tables"
          }
        },
        {
          "name": "GET /scylla/columns",
          "request": {
            "method": "GET",
            "header": [ { "key": "Accept", "value": "application/json" } ],
            "url": {
              "raw": "{{baseUrl}}/scylla/columns?table_name={{scylla_table_name}}",
              "query": [
                { "key": "table_name", "value": "{{scylla_table_name}}" }
              ]
            }
          }
        },
        {
          "name": "GET /scylla/list_tables",
          "request": {
            "method": "GET",
            "header": [ { "key": "Accept", "value": "application/json" } ],
            "url": "{{baseUrl}}/scylla/list_tables"
          }
        }
      ]
    },
    {
      "name": "Query",
      "item": [
        {
          "name": "POST /query/sql",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Accept", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"query\": \"select 1 as col\",\n  \"driver\": \"postgresql\",\n  \"db_name\": \"example_db\"\n}"
            },
            "url": "{{baseUrl}}/query/sql"
          }
        }
      ]
    },
    {
      "name": "Gateway /fetch and /data",
      "item": [
        {
          "name": "POST /gateway/fetch",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Accept", "value": "application/json" },
              { "key": "X-User-Id", "value": "{{X_User_Id}}" },
              { "key": "X-Athena-Client", "value": "{{X_Athena_Client}}" },
              { "key": "X-Strip-Nulls", "value": "{{X_Strip_Nulls}}" },
              { "key": "apikey", "value": "{{apikey}}" },
              { "key": "x-supabase-url", "value": "{{x_supabase_url}}" },
              { "key": "x-supabase-key", "value": "{{x_supabase_key}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"view_name\": \"invoices_view\",\n  \"columns\": [\"*\"],\n  \"conditions\": [\n    { \"eq_column\": \"company_id\", \"eq_value\": \"{{X_Company_Id}}\" }\n  ],\n  \"limit\": 100,\n  \"current_page\": 1,\n  \"page_size\": 100,\n  \"offset\": 0,\n  \"total_pages\": 1,\n  \"strip_nulls\": false\n}"
            },
            "url": "{{baseUrl}}/gateway/fetch"
          }
        },
        {
          "name": "GET /data",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "X-User-Id", "value": "{{X_User_Id}}" },
              { "key": "X-Athena-Client", "value": "{{X_Athena_Client}}" },
              { "key": "X-Strip-Nulls", "value": "{{X_Strip_Nulls}}" },
              { "key": "apikey", "value": "{{apikey}}" }
            ],
            "url": {
              "raw": "{{baseUrl}}/data?view=invoices_view&eq_column=company_id&eq_value={{X_Company_Id}}&columns=*&limit=100&current_page=1&page_size=100&offset=0&total_pages=1&strip_nulls=false",
              "query": [
                { "key": "view", "value": "invoices_view" },
                { "key": "eq_column", "value": "company_id" },
                { "key": "eq_value", "value": "{{X_Company_Id}}" },
                { "key": "columns", "value": "*" },
                { "key": "limit", "value": "100" },
                { "key": "current_page", "value": "1" },
                { "key": "page_size", "value": "100" },
                { "key": "offset", "value": "0" },
                { "key": "total_pages", "value": "1" },
                { "key": "strip_nulls", "value": "false" }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Gateway /insert and /delete",
      "item": [
        {
          "name": "PUT /gateway/insert",
          "request": {
            "method": "PUT",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Accept", "value": "application/json" },
              { "key": "X-User-Id", "value": "{{X_User_Id}}" },
              { "key": "X-Company-Id", "value": "{{X_Company_Id}}" },
              { "key": "X-Organization-Id", "value": "{{X_Organization_Id}}" },
              { "key": "X-Publish-Event", "value": "{{X_Publish_Event}}" },
              { "key": "X-Athena-Client", "value": "{{X_Athena_Client}}" },
              { "key": "apikey", "value": "{{apikey}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"table_name\": \"invoices\",\n  \"insert_body\": {\n    \"company_id\": \"{{X_Company_Id}}\",\n    \"amount\": 123.45,\n    \"status\": \"draft\"\n  },\n  \"update_body\": {\n    \"status\": \"sent\"\n  }\n}"
            },
            "url": "{{baseUrl}}/gateway/insert"
          }
        },
        {
          "name": "DELETE /gateway/delete",
          "request": {
            "method": "DELETE",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Accept", "value": "application/json" },
              { "key": "X-User-Id", "value": "{{X_User_Id}}" },
              { "key": "X-Company-Id", "value": "{{X_Company_Id}}" },
              { "key": "X-Organization-Id", "value": "{{X_Organization_Id}}" },
              { "key": "X-Athena-Client", "value": "{{X_Athena_Client}}" },
              { "key": "apikey", "value": "{{apikey}}" },
              { "key": "x-supabase-url", "value": "{{x_supabase_url}}" },
              { "key": "x-supabase-key", "value": "{{x_supabase_key}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"table_name\": \"invoices\",\n  \"resource_id\": \"<resource-uuid>\"\n}"
            },
            "url": "{{baseUrl}}/gateway/delete"
          }
        }
      ]
    },
    {
      "name": "Registry",
      "item": [
        {
          "name": "GET /router/registry",
          "request": {
            "method": "GET",
            "header": [ { "key": "Accept", "value": "application/json" } ],
            "url": "{{baseUrl}}/router/registry"
          }
        },
        {
          "name": "GET /registry",
          "request": {
            "method": "GET",
            "header": [ { "key": "Accept", "value": "application/json" } ],
            "url": "{{baseUrl}}/registry"
          }
        },
        {
          "name": "GET /registry/{api_registry_id}",
          "request": {
            "method": "GET",
            "header": [ { "key": "Accept", "value": "application/json" } ],
            "url": "{{baseUrl}}/registry/{{api_registry_id}}"
          }
        }
      ]
    }
    ,
    {
      "name": "Supabase",
      "item": [
        {
          "name": "POST /api/v2/supabase/ssl_enforcement",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Accept", "value": "application/json" },
              { "key": "apikey", "value": "{{apikey}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"enabled\": true,\n  \"access_token\": \"{{SUPABASE_ACCESS_TOKEN}}\",\n  \"project_ref\": \"{{PROJECT_REF}}\"\n}"
            },
            "url": "{{baseUrl}}/api/v2/supabase/ssl_enforcement"
          }
        }
      ]
    }
  ]
}


