Remove Users and Groups from Roles on Multiple Documents
Remove users and groups from roles on a document or binder in bulk.
- The maximum CSV input file size is 1GB.
- The values in the input must be UTF-8 encoded.
- CSVs must follow the standard RFC 4180 format, with some exceptions.
- The maximum batch size is 1000.
DELETE
/api/{version}/objects/documents/roles/batchHeaders
Section link for Headers| Name | Description |
|---|---|
Content-Type | text/csv or application/x-www-form-urlencoded |
Accept | application/json (default) or application/xml |
Body Parameters
Section link for Body ParametersYou can add parameters in the request body, or upload them as a CSV file.
| Name | Description |
|---|---|
idrequired | The document ID. |
role__v.usersoptional | A string of user id values to remove. |
role__v.groupsoptional | A string of group id values to remove. |
For example,
id | reviewer__v.users | reviewer__v.groups | approver__v.users | approver__v.groups |
|---|---|---|---|---|
| 771 | "12021,12022" | "3311303,3311404" | 22124 | 4411606 |
Request
Section link for Requestcurl -X DELETE -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: application/json" \
--data-binary @"C:\Vault\Document Roles\remove_document_roles.csv" \
https://myvault.veevavault.com/api/v24.2/objects/documents/roles/batchResponse
Section link for Response{
"responseStatus": "SUCCESS",
"data": [
{
"responseStatus": "SUCCESS",
"id": 5,
"coordinator__v.users": [
1008313
],
"consumer__v.users": [
1006595
]
}
]
}Response Details
Section link for Response DetailsOn SUCCESS, the response lists the IDs of the users or groups removed from the provided document roles. On FAILURE, the response returns an error message describing the reason for the failure. For example, a user or group may not be removed if the role assignment is system-managed.