POST /api/v2/conversations/calls returning 400 when injecting OTel trace context

Hey everyone,

I’m hitting a wall trying to kick off outbound calls programmatically via POST /api/v2/conversations/calls while maintaining distributed tracing. The goal is to inject the OpenTelemetry trace context into the customAttributes of the call object so we can correlate the Genesys Cloud interaction with our downstream services in Jaeger.

The issue is a 400 Bad Request with a generic validation error. It seems the API is rejecting the payload structure when I include the trace context, even though the JSON is valid.

Here’s the Python snippet using the official SDK:

from genesyscloud.conversations import ConversationsApi
from genesyscloud.rest import ApiException

# ... setup client and get auth_token ...

trace_context = {
 "traceId": "1234567890abcdef1234567890abcdef",
 "spanId": "abcdef1234567890",
 "parentSpanId": "1111111111111111",
 "traceFlags": "01"
}

body = {
 "from": {"phoneNumber": "+15551234567"},
 "to": [{"phoneNumber": "+15559876543"}],
 "customAttributes": {
 "otel.traceId": trace_context["traceId"],
 "otel.spanId": trace_context["spanId"]
 }
}

try:
 api_response = conversations_api.post_conversations_call(body=body)
 print("Call initiated: " + api_response.id)
except ApiException as e:
 print("Exception when calling ConversationsApi->post_conversations_call: %s\n" % e)

The error response body is:

{
 "errors": [
 {
 "code": "invalidRequest",
 "message": "The request body is invalid.",
 "path": "/customAttributes"
 }
 ]
}

If I remove the customAttributes block, the call initiates fine. I’ve verified the phone numbers are valid and the agent (who is making the call on behalf of the system) has the necessary permissions. The custom attributes schema in the docs suggests string values, which I’m providing.

Is there a restriction on injecting custom attributes during call creation? Or am I missing a specific header required for this operation? I’ve tried adding X-Trace-Id headers but that doesn’t seem to affect the body validation.

Thanks.