
I am trying to automate the process of giving some RLS policy to one of our teams in the organization:
I noticed the UI is using the following API:
https://prod-uk-a.online.tableau.com/api/-/data-composition/queryPolicyCollections/<id>/modify
so I tried locally to mimic with CURL:
> curl 'https://prod-uk-a.online.tableau.com/api/-/data-composition/queryPolicyCollections/<id>/modify' \
-H "X-Tableau-Auth: MY_TOKEN" \
--data-raw '{"luid":"<id>","etag":"17-16pwyARwwS5","commands":[{"sequence_number":1,"update_query_policy":{"luid":"b28d0744-4ea0-4cf3-91d5-8463b15dba9b","display_name":"Policy 1","description":"","template":{"row_filter":{"expression_filter":{"expression":"CONTAINS([Cust\nmer Last Name], \"a\")"}},"columns":[{"luid":"<id>","type":"STRING","display_name":"Policy Column 1"},{"luid":"58243e29-e062-47a8-aca4-9e8e79ae22ae","type":"STRING","display_name":"Customer Last Name"}]},"entitlement_is_null":"NULL_VALUE","command_luid":"2874efc8-928b-44dc-be89-07b47a4acfed"}}]}'
but I keep getting:
{"httpErrorCode":400,"message":"FAILED_PRECONDITION: Failed to update policy collection. Concurrent update detected. for resource id <id>"}%