# Outbound Events: Configure Kafka Event Streaming

> 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  
**API:** Outbound Events  
**Tags:** Outbound Events, Kafka, Confluent, Event Streaming, Webhooks, Real-time
**Last Updated:** 2026-03-20
**OpenAPI Endpoints:** /configs/v1/event-sinks
**Related Guides:** /guides/guide-outbound-events, /guides/guide-sandbox

## Summary

This example configures Outbound Events with Kafka as the message broker:

What are Outbound Events?
Real-time notifications sent to external systems when changes occur in IndyKite.

Supported events:
- Configuration changes (policies, queries created/updated/deleted)
- Graph data changes (nodes/relationships created/updated/deleted)
- Authorization events (evaluations, access decisions)

Architecture:
IndyKite -> Event Sink Configuration -> Kafka Topic -> Your Consumer Application

One Event Sink per project. Multiple routes can direct different event types to different topics.

## Use Case

Scenario: You want to receive notifications whenever configuration changes are made in your project.

Event flow:
1. Admin creates/updates/deletes a policy
2. IndyKite detects the configuration change
3. Event Sink sends message to Kafka topic
4. Your consumer application receives the event
5. Application can: log, alert, sync, trigger workflows

Example events (the eventType names the platform emits):
- Policy created: eventType "indykite.audit.config.create", data.type "CONFIG_TYPE_AUTHORIZATION_POLICY", data.id "gid:..."
- Node captured: eventType "indykite.audit.capture.upsert.node", data.node.type "Person", data.node.externalId "person-456"
- Authorization: eventType "indykite.audit.authorization.evaluation", data.results[].isAllowed true, data.request.body the AuthZEN request as a JSON string

Terraform registry for supported filters:
https://registry.terraform.io/providers/indykite/indykite/latest/docs/resources/event_sink

## Requirements

Prerequisites:
- ServiceAccount credentials: For creating Event Sink configuration (Bearer token)
- Confluent Cloud account: With API key and cluster access
- Kafka topic: Created in your Confluent environment

Confluent requirements:
- Cluster bootstrap URL
- API Key and Secret for authentication
- Topic name for event delivery

## Steps

Step 1: Create Kafka Topic on Confluent.
    2. Create an Outbound Events configuration and a KBAC policy configuration.
    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).
    

## Code Examples

### Step 2

Create an EventSink configuration. 

**POST https://eu.api.indykite.com/configs/v1/event-sinks**

```json
{
  "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"
    }
  ]
}
```


Create a simple Policy which designates the Person nodes who can drive a resource Car. 

**policy.json**

```json
{
  "meta": {
    "policy_version": "2.0-kbac"
  },
  "subject": {
    "type": "Person"
  },
  "actions": [
    "CAN_DRIVE"
  ],
  "resource": {
    "type": "Car"
  },
  "condition": {
    "cypher": "MATCH (subject:Person)-[:DRIVES]->(resource:Car)"
  }
}
```

## Common Errors

### 401: UNAUTHENTICATED

**Solution:** Verify ServiceAccount credentials are valid

### 400: INVALID_ARGUMENT

**Solution:** Check event sink configuration format and destination URL

---

Source: https://developer.indykite.com/resources/event-1