Trying to start a recording programmatically via the API instead of relying on the Architect flow. The goal is to trigger recording from a backend service when a specific condition is met.
I’m sending a request to update the recording state for a conversation. The endpoint returns a 409 Conflict. The error payload says:
{
"errors": [
{
"code": "409",
"message": "Recording is already in progress for this conversation"
}
]
}
This happens even if I haven’t started a recording manually or via the UI. I checked the call status in the admin console and no recording is active. I tried waiting 5 seconds between requests, same result.
Also tried getting the recording status first via GET /api/v2/conversations/{conversationId}/recordingmetadata/{recordingId} but that returns 404 if no recording exists.
Is there a race condition here? Or do I need to pass specific headers to override the lock? The docs don’t mention anything about pre-existing locks on new calls.
Here’s the curl I’m using:
curl -X PUT "https://api.mypurecloud.com/api/v2/conversations/calls/abc-123/recordingstate" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"recordingState": "active"}'
The token is valid, I can fetch user details fine. Just stuck on this 409.