Struggling to understand why the Workforce Engagement Management API endpoint /api/v2/wem/integrations returns a 400 Bad Request when attempting to correlate session data with our APAC BYOC trunks. The payload includes valid SIP call IDs from our Singapore SBC logs, yet the response cites invalid_correlation_source. We are using SDK version 2.4.1. Is there a specific format required for the trunk ID in the correlation object for BYOC sources?
If I recall correctly, the WEM API is quite strict about how it expects the correlation_source object to be structured when dealing with BYOC trunks, specifically regarding the id field’s format. The error invalid_correlation_source usually indicates that the payload is missing the required type discriminator or that the id isn’t matching the exact internal identifier Genesys Cloud uses for that specific trunk instance, rather than the external SIP Call-ID or a human-readable name.
For BYOC integrations, the correlation_source object must explicitly define the type as TRUNK. The id field should contain the UUID of the trunk resource within Genesys Cloud, which you can retrieve via the /api/v2/telephony/providers/edges/trunks endpoint. It is not sufficient to pass the SIP Call-ID from the SBC logs directly into the id field; instead, that SIP Call-ID should be mapped to the correct Genesys Cloud Trunk UUID before sending the correlation request.
Here is the corrected payload structure:
{
"correlation_source": {
"type": "TRUNK",
"id": "your-genesys-cloud-trunk-uuid-here",
"sip_call_id": "your-sbc-sip-call-id-here"
},
"session_data": { ... }
}
Ensure that the sip_call_id matches exactly what appears in the Genesys Cloud conversation logs for that specific trunk session. If the trunk was recently provisioned, there might be a slight propagation delay in the WEM integration metadata. Also, verify that the API token used has the wem:read and wem:write scopes, as insufficient permissions can sometimes manifest as vague 400 errors in earlier SDK versions. Check the SDK documentation for version 2.4.1 to confirm if any schema changes were introduced regarding the correlation_source object, as older versions might have had different validation rules.