Guest API trace context injection fails on /conversations/messaging/events

Trying to bypass the standard Messenger widget to build a custom UI for a specific client integration. The requirement is to handle the full guest lifecycle via the Guest API (/api/v2/messaging/guests) and the Web Messaging API endpoints directly.

The setup works for creating the guest and the conversation, but when I try to inject the OpenTelemetry trace context into the X-GC-Trace-Id header on the POST /api/v2/messaging/conversations/{conversationId}/events call, the server returns a 400 Bad Request. The response body says Invalid request body.

Here is the payload I’m sending:

{
 "type": "message",
 "content": "Hello world",
 "metadata": {
 "otel.traceId": "abc123...",
 "otel.spanId": "def456..."
 }
}

I’ve tried moving the trace IDs into the headers object of the request instead of the body, but the API doesn’t seem to accept custom headers for this specific endpoint in the same way the REST client does.

Is there a documented way to pass trace context through the Guest API event stream? Or should I be using a different endpoint to ensure the span propagates to the backend Data Actions that trigger on message.created events? The current approach breaks the distributed tracing chain.

The Guest API doesn’t support custom headers for trace context injection. You’ll need to set the traceId field directly in the guest creation payload instead of relying on HTTP headers. Here’s how that looks:

{
 "traceId": "your-opentelemetry-trace-id-here"
}

Make sure the ID matches the expected format for your tracing system.