Skip to main content
Use this guide when you need to show that the same end user can interact across two channels and that both channels produce unified, auditable logs. The pattern below uses a WhatsApp webhook as channel one and a web app as channel two. Both harnesses send the same X-On-Behalf-Of end-user ID and both write JSONL audit events keyed by the same response_id and conversation_id.
Use the same MKA1 API key in both harnesses. Two different API keys represent two different MKA1 API users. Using the same X-On-Behalf-Of value is not enough if the WhatsApp harness and web harness authenticate with different API keys. For this evidence flow, both channels must share the same MKA1 API key and the same X-On-Behalf-Of end-user ID.
For the base request pattern, see generate a response. If you need to create or manage a reusable conversation ID per end user, see manage conversations.

Architecture

WhatsApp end user message -> WhatsApp webhook receives the message -> your server calls mka1.llm.responses.create with store: true -> your server logs the full stored response object and response_id -> your server sends the reply back to WhatsApp -> your web app requests the same response_id from your backend -> your backend calls mka1.llm.responses.get -> your backend logs the web retrieval against the same response_id and conversation_id
Keep your API key on the server. The browser should call your backend route, not the MKA1 API directly.

Use one end-user ID across both channels

The X-On-Behalf-Of value is the key that ties the channels together at the end-user level. Use the same stable end-user ID in both harnesses. You must also use the same shared MKA1 API key in both harnesses. Examples:
  • WhatsApp webhook maps a phone number to user_123.
  • Web app session for the same person also resolves to user_123.
  • Both harnesses authenticate with the same MKA1 API key.
If the X-On-Behalf-Of value changes between channels, the logs are no longer auditable as one end-user conversation. If the API key changes between channels, the requests belong to different MKA1 API users even when X-On-Behalf-Of matches.

WhatsApp harness: store the response and log it

Start with one shared SDK wrapper that both harnesses use. This keeps authentication, conversation creation, response retrieval, and response creation consistent across channels.
Then use that wrapper in your WhatsApp webhook. Create the conversation once for the end user, reuse it across turns, and capture the audit event from the stored response.
This is the critical evidence point for channel one:
  • WhatsApp is the ingress channel.
  • The request is stored with store: true.
  • The full response object is logged in an open format.
  • The log includes response_id, conversation_id, and end_user_id.

Web harness: retrieve the same stored response

The web app should call your own backend. That backend can retrieve the same response with mka1.llm.responses.get and log the retrieval as a second channel event.
Minimal browser call:
This is the critical evidence point for channel two:
  • The web app is a separate channel from WhatsApp.
  • It retrieves the same stored MKA1 response by response_id.
  • It logs that retrieval into the same JSONL audit stream.
  • The retrieved object still carries the same end-user and conversation linkage.

Unified audit export in an open format

Example export:

Authentication requirement for shared logs

For this multichannel demonstration, all of the following must match across the WhatsApp and web harnesses:
  • the same MKA1 API key
  • the same X-On-Behalf-Of end-user ID
  • the same stored response_id
  • the same conversation_id when you use conversations
If either harness uses a different API key, you are no longer showing one shared MKA1 API user context across channels.