Does anyone understand why the PATCH request to disconnect a specific participant from a conference call returns a 404?
I am using the Conversations API in my Terraform validation scripts. The endpoint is /api/v2/conversations/phone/participants/{participantId}. I am sending PUT with body {"status": "disconnected"}. The participant ID is valid, confirmed via the GET endpoint. The conversation is active. Yet I get 404 Not Found.
Is this endpoint restricted for conference legs, or is there a specific header requirement I am missing in my Python requests library call?
Check your HTTP method. The endpoint requires PATCH, not PUT. Your payload is also incorrect for this operation.
- Use
PATCH /api/v2/conversations/phone/participants/{id}.
- Set header
Content-Type: application/json.
- Send body
{"status": "disconnected"}.
The 404 often stems from using the wrong verb on a resource that expects partial updates.
Have you tried verifying the OAuth scopes and the participant ID structure before assuming the endpoint is the only issue? The suggestion above regarding the HTTP method is technically correct, but if the underlying token lacks admin:conversation or the ID refers to a softphone leg rather than a bridge participant, you will still hit a 404.
- Confirm your token has
admin:conversation scope.
- Ensure the
participantId matches the specific leg returned by GET /api/v2/conversations/phone/participants.
- Use
PATCH with {"status": "disconnected"}.
Could someone explain why the PATCH request to disconnect a specific participant from a conference call returns a 404?
I usually solve this by auditing the participantId source against the conversation entity type. The 404 is rarely a scope issue when you already confirmed the ID exists via GET. It is usually a method mismatch or an entity mismatch.
- Verify HTTP Verb: You listed
PATCH in the title but PUT in the body. The API strictly requires PATCH. PUT often returns 404 because the resource does not support full replacement.
- Check Entity Type: Ensure the conversation is
phone. If it is video or webchat, the endpoint path changes.
- Use cURL for Isolation: Bypass your Terraform abstraction. Test with raw HTTP to rule out client-side serialization errors.
curl -X PATCH "https://api.us.genesys.cloud/api/v2/conversations/phone/participants/{participantId}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"status": "disconnected"}'
If this returns 404, your ID is likely stale or belongs to a different conversation lifecycle state.
You should probably look at at how the participant ID is being resolved in your validation logic. The 404 is rarely a scope issue when you already confirmed the ID exists via GET. It is usually a method mismatch or an entity mismatch.
In Genesys Cloud, the participantId is not a static identifier for the human agent or caller. It is a transient resource tied to the specific conversation instance. If your Terraform script retrieves the participant list, processes it asynchronously, and then attempts to disconnect, you are likely hitting a race condition. The participant may have already been removed by the system or another process, causing the subsequent PATCH to target a non-existent resource.
Additionally, verify the exact structure of the PATCH body. While {"status": "disconnected"} is common, the API is strict about the Content-Type header. If you are using a tool like curl or a native HTTP client in Terraform, ensure you are not accidentally sending application/x-www-form-urlencoded.
Here is a robust curl example that handles the headers and payload correctly:
curl -X PATCH "https://api.mypurecloud.com/api/v2/conversations/phone/participants/{participantId}" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"status": "disconnected"}'
If you are using the PureCloudPlatformClientV2 SDK, use the patchConversationPhoneParticipant method directly. It handles the JSON serialization and status checks internally.
Also, check if the participant is in a conference vs a direct call. Conference legs sometimes require a different sequence of API calls to ensure the bridge is updated before the leg is disconnected. If you are disconnecting the last participant, the conversation itself will terminate, which might cause subsequent API calls on that conversation ID to fail with 404.