{
  "id": "event-1",
  "title": "Outbound Events: Configure Kafka Event Streaming",
  "description": "Set up real-time event streaming from IndyKite to Kafka (Confluent). Receive notifications when graph data changes, configurations are modified, or specific actions occur.",
  "category": "Outbound Events",
  "tags": [
    "Outbound Events",
    "Kafka",
    "Confluent",
    "Event Streaming",
    "Webhooks",
    "Real-time"
  ],
  "api": "Outbound Events",
  "language": "Json",
  "lastUpdated": "2026-03-20",
  "openApiEndpoints": [
    "/configs/v1/event-sinks"
  ],
  "relatedGuides": [
    "/guides/guide-outbound-events",
    "/guides/guide-sandbox"
  ],
  "commonErrors": [
    {
      "code": "401",
      "message": "UNAUTHENTICATED",
      "solution": "Verify ServiceAccount credentials are valid"
    },
    {
      "code": "400",
      "message": "INVALID_ARGUMENT",
      "solution": "Check event sink configuration format and destination URL"
    }
  ],
  "summary": "This example configures Outbound Events with Kafka as the message broker:\n\nWhat are Outbound Events?\nReal-time notifications sent to external systems when changes occur in IndyKite.\n\nSupported events:\n- Configuration changes (policies, queries created/updated/deleted)\n- Graph data changes (nodes/relationships created/updated/deleted)\n- Authorization events (evaluations, access decisions)\n\nArchitecture:\nIndyKite -> Event Sink Configuration -> Kafka Topic -> Your Consumer Application\n\nOne Event Sink per project. Multiple routes can direct different event types to different topics.",
  "usecase": "Scenario: You want to receive notifications whenever configuration changes are made in your project.\n\nEvent flow:\n1. Admin creates/updates/deletes a policy\n2. IndyKite detects the configuration change\n3. Event Sink sends message to Kafka topic\n4. Your consumer application receives the event\n5. Application can: log, alert, sync, trigger workflows\n\nExample events (the eventType names the platform emits):\n- Policy created: eventType \"indykite.audit.config.create\", data.type \"CONFIG_TYPE_AUTHORIZATION_POLICY\", data.id \"gid:...\"\n- Node captured: eventType \"indykite.audit.capture.upsert.node\", data.node.type \"Person\", data.node.externalId \"person-456\"\n- Authorization: eventType \"indykite.audit.authorization.evaluation\", data.results[].isAllowed true, data.request.body the AuthZEN request as a JSON string\n\nTerraform registry for supported filters:\nhttps://registry.terraform.io/providers/indykite/indykite/latest/docs/resources/event_sink",
  "requirements": "Prerequisites:\n- ServiceAccount credentials: For creating Event Sink configuration (Bearer token)\n- Confluent Cloud account: With API key and cluster access\n- Kafka topic: Created in your Confluent environment\n\nConfluent requirements:\n- Cluster bootstrap URL\n- API Key and Secret for authentication\n- Topic name for event delivery",
  "steps": "Step 1: Create Kafka Topic on Confluent.\n    2. Create an Outbound Events configuration and a KBAC policy configuration.\n    3. Check that messages are received in the topic each time a CRUD action is executed on any configuration node (including any read action on Outbound Events).\n    ",
  "code": [
    {
      "step": "Step 2",
      "description": "Create an EventSink configuration. ",
      "filename": "POST https://eu.api.indykite.com/configs/v1/event-sinks",
      "language": "Json",
      "ingest": {
        "project_id": "your_project_gid",
        "description": "description of eventsink",
        "display_name": "eventsink name",
        "name": "eventsink-name",
        "include_cdc_events": false,
        "providers": {
          "provider-with-kafka": {
            "kafka": {
              "brokers": [
                "your-destination:9092"
              ],
              "disable_tls": false,
              "tls_skip_verify": false,
              "topic": "topic_signal",
              "username": "api_key",
              "password": "api_key_secret"
            }
          }
        },
        "routes": [
          {
            "provider_id": "provider-with-kafka",
            "event_type_key_values_filter": {
              "event_type": "indykite.audit.config.*"
            },
            "stop_processing": true,
            "display_name": "Configuration Audit Events"
          }
        ]
      }
    },
    {
      "description": "Create a simple Policy which designates the Person nodes who can drive a resource Car. ",
      "filename": "policy.json",
      "language": "Json",
      "ingest": {
        "meta": {
          "policy_version": "2.0-kbac"
        },
        "subject": {
          "type": "Person"
        },
        "actions": [
          "CAN_DRIVE"
        ],
        "resource": {
          "type": "Car"
        },
        "condition": {
          "cypher": "MATCH (subject:Person)-[:DRIVES]->(resource:Car)"
        }
      }
    }
  ],
  "links": {
    "html": "/resources/event-1",
    "markdown": "/resources/event-1.md",
    "openApi": "https://openapi.indykite.com/"
  }
}