Anyone free to help troubleshoot this validation error when attempting to programmatically attach legal hold metadata to agent scripts via the Agent Scripting API. We are managing digital channel transcripts for legal discovery and need to ensure specific scripts used in Webchat interactions are flagged correctly for chain of custody purposes. The environment is Genesys Cloud 2023-12, using the Python SDK v2.18.0.
The issue occurs when calling POST /api/v2/agent-scripts. The request fails immediately with a 400 Bad Request. The error message states: Invalid parameter: metadata.legal_hold_status is not a valid field for agent scripts.
Here are the steps to reproduce:
- Generate a valid OAuth2 access token with
agent-scripts:writeandanalytics:readscopes. - Construct a JSON payload for the script creation. The payload includes standard fields like
name,type, andcontent. - Add a custom metadata object to the payload:
"metadata": {"legal_hold_status": "active", "case_id": "DISC-2023-001"}. - Send the POST request to
/api/v2/agent-scripts. - The server responds with 400 Bad Request.
We suspect this might be related to the digital channel specialization, as voice scripts do not require this level of granular metadata for legal holds. However, the documentation for the Agent Scripting API does not explicitly list supported custom metadata keys. We have tried omitting the metadata object and using only standard tags, but the legal team requires the explicit legal_hold_status field for audit trails.
Is there a specific endpoint or workaround to attach this metadata without triggering the validation error? We need this data to be present in the bulk export jobs for digital channels later. Any insights on the correct schema for legal hold metadata in agent scripts would be appreciated.