Trying to programmatically stop a recording for an active voice conversation using the Genesys Cloud Recording API. The docs say PUT /api/v2/recordings/conversations/{conversationId} should work, but it’s returning a 404 Not Found. The conversation is definitely live and recording, confirmed via the GET /api/v2/conversations/voice endpoint which shows recording: { state: 'recording' }.
Here’s the TypeScript snippet using the official @genesys/cloud SDK:
const recordingApi = new RecordingApi();
const conversationId = 'abc-123-def-456';
try {
await recordingApi.putRecordingsConversationsConversationId({
conversationId,
body: {
recording: {
state: 'stopped'
}
}
});
console.log('Recording stopped');
} catch (error) {
console.error('Failed to stop recording:', error);
}
The error payload looks like this:
{
"errors": [
{
"code": "not_found",
"message": "Recording not found for conversation abc-123-def-456"
}
]
}
I’ve tried waiting 5-10 seconds after the call starts before hitting the endpoint, but same result. The conversation ID is correct, copied straight from the live event stream. Is there a specific state the recording needs to be in before it can be stopped via API? Or is this a known issue with the SDK’s putRecordingsConversationsConversationId method? The GET endpoint works fine for retrieving the recording status, so authentication isn’t the problem. Just can’t seem to flip the switch to stop it. Any ideas?