curl -X POST '{MOCK_ADAPTER_URL}/api/kafka-exchanges/' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"incomingTopic": "ai.flowx.in.adapter.kyc.clientCheckPf.v1",
"outgoingTopic": "to.flowx.updates.qa.adapter.kyc.clientcheck.v1",
"receivedMessageJson": null,
"sentMessageJson": "{ \"status\": \"success\", \"response\": [] }"
}'
{
"id": "mock_exchange_123",
"incomingTopic": "ai.flowx.in.adapter.kyc.clientCheckPf.v1",
"outgoingTopic": "to.flowx.updates.qa.adapter.kyc.clientcheck.v1",
"receivedMessageJson": null,
"sentMessageJson": "{ \"status\": \"success\", \"response\": [] }",
"createdAt": "2024-01-15T10:30:00Z",
"isActive": true
}
Add new Kafka exchange mock
Create a new Kafka exchange mock to simulate message flows between FlowX Engine and external integrations during development and testing
POST
{MOCK_ADAPTER_URL}
/
api
/
kafka-exchanges
/
curl -X POST '{MOCK_ADAPTER_URL}/api/kafka-exchanges/' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"incomingTopic": "ai.flowx.in.adapter.kyc.clientCheckPf.v1",
"outgoingTopic": "to.flowx.updates.qa.adapter.kyc.clientcheck.v1",
"receivedMessageJson": null,
"sentMessageJson": "{ \"status\": \"success\", \"response\": [] }"
}'
{
"id": "mock_exchange_123",
"incomingTopic": "ai.flowx.in.adapter.kyc.clientCheckPf.v1",
"outgoingTopic": "to.flowx.updates.qa.adapter.kyc.clientcheck.v1",
"receivedMessageJson": null,
"sentMessageJson": "{ \"status\": \"success\", \"response\": [] }",
"createdAt": "2024-01-15T10:30:00Z",
"isActive": true
}
Reference under review. This endpoint is exposed by the mock-server, a development and testing component — not a production-facing API. For supported integration patterns, see Consuming FlowX from external apps.
Kafka mocks are essential for testing process flows that depend on external integrations, allowing you to simulate various response scenarios and edge cases.
Authentication
This endpoint requires Bearer Token authentication. Include your API token in the Authorization header.Bearer token for API authentication. Format:
Bearer YOUR_API_TOKENURL Parameters
The base URL of the mock adapter service where Kafka exchange mocks are managed.
Request Body Parameters
The Kafka topic name that the external integration listens on for incoming messages from FlowX Engine. This should match exactly with your integration’s configuration.Example:
ai.flowx.in.adapter.kyc.clientCheckPf.v1The Kafka topic name that FlowX Engine listens on for replies from the external integration. This should match the topic configured in your process definition.Example:
to.flowx.updates.qa.adapter.kyc.clientcheck.v1The JSON message that will be sent to the external integration. Use
null if you want to test scenarios where no specific message content is required, or provide a JSON string for specific message simulation.The JSON response message that the mock will return to FlowX Engine, simulating the external integration’s response. This allows you to test different response scenarios.
Request Example
curl -X POST '{MOCK_ADAPTER_URL}/api/kafka-exchanges/' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"incomingTopic": "ai.flowx.in.adapter.kyc.clientCheckPf.v1",
"outgoingTopic": "to.flowx.updates.qa.adapter.kyc.clientcheck.v1",
"receivedMessageJson": null,
"sentMessageJson": "{ \"status\": \"success\", \"response\": [] }"
}'
const response = await fetch('{MOCK_ADAPTER_URL}/api/kafka-exchanges/', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
incomingTopic: 'ai.flowx.in.adapter.kyc.clientCheckPf.v1',
outgoingTopic: 'to.flowx.updates.qa.adapter.kyc.clientcheck.v1',
receivedMessageJson: null,
sentMessageJson: '{ "status": "success", "response": [] }'
})
});
import requests
response = requests.post(
'{MOCK_ADAPTER_URL}/api/kafka-exchanges/',
headers={
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
json={
'incomingTopic': 'ai.flowx.in.adapter.kyc.clientCheckPf.v1',
'outgoingTopic': 'to.flowx.updates.qa.adapter.kyc.clientcheck.v1',
'receivedMessageJson': None,
'sentMessageJson': '{ "status": "success", "response": [] }'
}
)
Response Examples
{
"id": "mock_exchange_123",
"incomingTopic": "ai.flowx.in.adapter.kyc.clientCheckPf.v1",
"outgoingTopic": "to.flowx.updates.qa.adapter.kyc.clientcheck.v1",
"receivedMessageJson": null,
"sentMessageJson": "{ \"status\": \"success\", \"response\": [] }",
"createdAt": "2024-01-15T10:30:00Z",
"isActive": true
}
{
"error": "Invalid request",
"message": "incomingTopic is required and must be a valid topic name",
"code": "INVALID_TOPIC_NAME"
}
{
"error": "Unauthorized",
"message": "Invalid or missing authentication token"
}
Usage Tips
Testing Different Scenarios: Create multiple mocks with different
sentMessageJson values to test various response scenarios like success, failure, and edge cases in your process flows.Topic Naming: Ensure your topic names follow your organization’s Kafka topic naming conventions and match exactly with your integration configurations.
Mock exchanges are intended for development and testing environments only. Do not use mocked integrations in production systems.
Last modified on May 12, 2026
Was this page helpful?
⌘I

