Trying to make sense of why the Genesys Cloud API is rejecting a valid SIP URI in the participant address. I’m using Python requests to initiate an outbound call via /api/v2/conversations/calls. The endpoint is POST /api/v2/conversations/calls.
The payload looks standard. I’ve verified the user token is cached in Redis and hasn’t expired. The toAddress is a proper SIP URI string.
The response is consistently 400 Bad Request. The error message says Invalid participant address. I’ve checked the docs and it seems like it should accept SIP URIs for internal users. I’m not seeing any obvious formatting issues. The fromAddress is E.164 formatted.
Is there a specific requirement for the toAddress format when using this endpoint that isn’t clearly documented? Or is this a known issue with certain tenant configurations? I’ve tried escaping the @ symbol but that just breaks the URI structure further.
Why is the API rejecting a valid SIP URI in the toAddress field for POST /api/v2/conversations/calls?
Yep, this is a known issue… the SDK doesn’t validate the SIP URI format strictly enough before sending, so you get a 400 from the platform. the problem isn’t just the string format. it’s how you’re constructing the to object. you need to explicitly set the type to sip and ensure the address is stripped of any whitespace. also, make sure your app has the call:write scope. if you’re using the TS SDK, here’s the correct way to build the participant object.
import { PlatformClient } from '@genesyscloud/purecloud-platform-client-v2-typescript';
const client = PlatformClient.init();
const conversationRequest: ConversationsApi.ConversationCreateRequest = {
to: {
type: 'sip',
address: 'sip:[email protected]', // no whitespace, explicit type
name: 'Outbound SIP Call'
},
from: {
type: 'user',
id: 'your-user-id', // or number if calling from a number
name: 'My User'
},
type: 'call'
};
try {
const response = await client.ConversationsApi.postConversationsCalls(conversationRequest);
console.log('Call initiated:', response);
} catch (error) {
console.error('Failed to initiate call:', error);
}
if you’re still getting 400s, check the error body. it usually points to a missing type or an invalid address format. the platform is strict about SIP URIs. they must be fully qualified. also, ensure your tenant has SIP trunking enabled. if it’s a CXone tenant, the API path might differ slightly. but for Genesys Cloud, this is the standard approach. don’t forget to handle the 403 if the user doesn’t have permissions. and if you’re using a number as the from, make sure it’s associated with the user or org. otherwise, the platform rejects it. i’ve seen this trip people up before. the SDK types are helpful, but the platform validation is stricter. always check the raw error response. it’s usually clearer than the SDK error. also, make sure you’re using the latest SDK version. older versions had bugs with SIP URI parsing. upgrade if you’re on anything below 2.0.0. and if you’re using curl, the JSON structure is the same. just ensure the Content-Type is application/json. otherwise, the parser fails. simple stuff, but easy to miss.