Realtime API: is it possible to track with event triggered a response?
I don’t think the Realtime API currently exposes a direct “triggering client event ID” field on server events.
response.create can include an optional client-side event_id, but the later response.created event has its own server-side event_id and the new response.id. It does not appear to echo the original response.create.event_id.
For debugging, the best workaround is to include your own correlation ID in response.metadata:
{
"type": "response.create",
"event_id": "client_event_123",
"response": {
"metadata": {
"client_event_id": "client_event_123",
"debug_reason": "manual_retry"
}
}
}
Then inspect response.metadata on response.created or response.done and map it to the returned response.id.
One related detail: only one Response can write to the default Conversation at a time, but out-of-band responses can run in parallel. The docs specifically call out metadata as a useful way to disambiguate simultaneous Responses.
Discussion in the ATmosphere