{
  "info": {
    "name": "Conduktor API",
    "description": "Conduktor Console and Gateway REST API. Console endpoints use a Bearer API key generated by an admin in Settings > API Keys; Gateway admin endpoints use HTTP Basic auth. Set {{consoleUrl}} and {{gatewayUrl}} to your deployment hosts.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "consoleUrl",
      "value": "https://localhost:8080"
    },
    {
      "key": "gatewayUrl",
      "value": "https://localhost:8888"
    },
    {
      "key": "bearerToken",
      "value": ""
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{bearerToken}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Clusters",
      "item": [
        {
          "name": "List registered Kafka clusters",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{consoleUrl}}/public/v1/clusters",
              "host": ["{{consoleUrl}}"],
              "path": ["public", "v1", "clusters"]
            }
          }
        },
        {
          "name": "Create or update a Kafka cluster",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apiVersion\": \"v1\",\n  \"kind\": \"KafkaCluster\",\n  \"metadata\": { \"name\": \"my-cluster\" },\n  \"spec\": { \"displayName\": \"My Cluster\", \"bootstrapServers\": \"broker:9092\" }\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{consoleUrl}}/public/v1/clusters",
              "host": ["{{consoleUrl}}"],
              "path": ["public", "v1", "clusters"]
            }
          }
        },
        {
          "name": "Delete a Kafka cluster",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{consoleUrl}}/public/v1/clusters/:cluster",
              "host": ["{{consoleUrl}}"],
              "path": ["public", "v1", "clusters", ":cluster"],
              "variable": [{ "key": "cluster", "value": "my-cluster" }]
            }
          }
        }
      ]
    },
    {
      "name": "Certificates",
      "item": [
        {
          "name": "List trusted certificates",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{consoleUrl}}/public/v1/certificates",
              "host": ["{{consoleUrl}}"],
              "path": ["public", "v1", "certificates"]
            }
          }
        }
      ]
    },
    {
      "name": "Users",
      "item": [
        {
          "name": "List organization users",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{consoleUrl}}/public/iam/v2/user",
              "host": ["{{consoleUrl}}"],
              "path": ["public", "iam", "v2", "user"]
            }
          }
        }
      ]
    },
    {
      "name": "Groups",
      "item": [
        {
          "name": "Get a group and its permissions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{consoleUrl}}/public/iam/v2/group/:groupName",
              "host": ["{{consoleUrl}}"],
              "path": ["public", "iam", "v2", "group", ":groupName"],
              "variable": [{ "key": "groupName", "value": "project-a" }]
            }
          }
        },
        {
          "name": "Create or update a group",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apiVersion\": \"iam/v2\",\n  \"kind\": \"Group\",\n  \"metadata\": { \"name\": \"project-a\" },\n  \"spec\": { \"displayName\": \"Project A\", \"permissions\": [] }\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{consoleUrl}}/public/iam/v2/group/:groupName",
              "host": ["{{consoleUrl}}"],
              "path": ["public", "iam", "v2", "group", ":groupName"],
              "variable": [{ "key": "groupName", "value": "project-a" }]
            }
          }
        }
      ]
    },
    {
      "name": "Self-Service",
      "item": [
        {
          "name": "Create or update an Application",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apiVersion\": \"self-serve/v1\",\n  \"kind\": \"Application\",\n  \"metadata\": { \"name\": \"clickstream\" },\n  \"spec\": { \"title\": \"Clickstream\", \"owner\": \"project-a\" }\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{consoleUrl}}/public/self-serve/v1/application",
              "host": ["{{consoleUrl}}"],
              "path": ["public", "self-serve", "v1", "application"]
            }
          }
        },
        {
          "name": "Create or update a TopicPolicy",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apiVersion\": \"self-serve/v1\",\n  \"kind\": \"TopicPolicy\",\n  \"metadata\": { \"name\": \"generic-prod-topic-policy\" },\n  \"spec\": { \"policies\": {} }\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{consoleUrl}}/public/self-serve/v1/topic-policy",
              "host": ["{{consoleUrl}}"],
              "path": ["public", "self-serve", "v1", "topic-policy"]
            }
          }
        }
      ]
    },
    {
      "name": "Gateway Interceptors",
      "item": [
        {
          "name": "List Gateway interceptors",
          "request": {
            "auth": {
              "type": "basic",
              "basic": [
                { "key": "username", "value": "{{gatewayAdminUser}}", "type": "string" },
                { "key": "password", "value": "{{gatewayAdminPassword}}", "type": "string" }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{gatewayUrl}}/gateway/v2/interceptor",
              "host": ["{{gatewayUrl}}"],
              "path": ["gateway", "v2", "interceptor"]
            }
          }
        },
        {
          "name": "Create or update a Gateway interceptor",
          "request": {
            "auth": {
              "type": "basic",
              "basic": [
                { "key": "username", "value": "{{gatewayAdminUser}}", "type": "string" },
                { "key": "password", "value": "{{gatewayAdminPassword}}", "type": "string" }
              ]
            },
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apiVersion\": \"gateway/v2\",\n  \"kind\": \"Interceptor\",\n  \"metadata\": { \"name\": \"produce-rate-limit\" },\n  \"spec\": { \"pluginClass\": \"io.conduktor.gateway.interceptor.safeguard.ProduceRateLimitingPolicyPlugin\", \"priority\": 100, \"config\": {} }\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{gatewayUrl}}/gateway/v2/interceptor",
              "host": ["{{gatewayUrl}}"],
              "path": ["gateway", "v2", "interceptor"]
            }
          }
        }
      ]
    },
    {
      "name": "Gateway Virtual Clusters",
      "item": [
        {
          "name": "Create or update a virtual cluster",
          "request": {
            "auth": {
              "type": "basic",
              "basic": [
                { "key": "username", "value": "{{gatewayAdminUser}}", "type": "string" },
                { "key": "password", "value": "{{gatewayAdminPassword}}", "type": "string" }
              ]
            },
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apiVersion\": \"gateway/v2\",\n  \"kind\": \"VirtualCluster\",\n  \"metadata\": { \"name\": \"team-a\" },\n  \"spec\": { \"aclEnabled\": true, \"superUsers\": [\"admin\"] }\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{gatewayUrl}}/gateway/v2/virtual-cluster",
              "host": ["{{gatewayUrl}}"],
              "path": ["gateway", "v2", "virtual-cluster"]
            }
          }
        },
        {
          "name": "Get a virtual cluster",
          "request": {
            "auth": {
              "type": "basic",
              "basic": [
                { "key": "username", "value": "{{gatewayAdminUser}}", "type": "string" },
                { "key": "password", "value": "{{gatewayAdminPassword}}", "type": "string" }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{gatewayUrl}}/gateway/v2/virtual-cluster/:name",
              "host": ["{{gatewayUrl}}"],
              "path": ["gateway", "v2", "virtual-cluster", ":name"],
              "variable": [{ "key": "name", "value": "team-a" }]
            }
          }
        },
        {
          "name": "Generate a service account token",
          "request": {
            "auth": {
              "type": "basic",
              "basic": [
                { "key": "username", "value": "{{gatewayAdminUser}}", "type": "string" },
                { "key": "password", "value": "{{gatewayAdminPassword}}", "type": "string" }
              ]
            },
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"username\": \"app-user\",\n  \"vCluster\": \"team-a\",\n  \"lifeTimeSeconds\": 3600\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{gatewayUrl}}/gateway/v2/token",
              "host": ["{{gatewayUrl}}"],
              "path": ["gateway", "v2", "token"]
            }
          }
        }
      ]
    }
  ]
}
