Assign Users & Groups to Roles on Object Records
Assign users and groups to roles on an object record 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 500.
POST
/api/{version}/vobjects/{object_name}/rolesAssigning users and groups to roles is additive, and duplicate groups are ignored. For example, if groups 1 and 2 are currently assigned to a particular role and you assign groups 2 and 3 to the same role, the final list of groups assigned to the role will be 1, 2, and 3.
Headers
Section link for Headers| Name | Description |
|---|---|
Content-Type | text/csv or application/json |
Accept | application/json (default), text/csv, or application/xml |
URI Path Parameters
Section link for URI Path Parameters| Name | Description |
|---|---|
{object_name} | The name of the object where you want to update records. |
Body Parameters
Section link for Body ParametersPrepare a JSON or CSV input file. User and group assignments are ignored if they are invalid, inactive, or already exist.
| Name | Description |
|---|---|
id | The object record ID. |
role__v.users | A string of user id values for the new role. |
role__v.groups | A string of user id values for the new group. |
See Example JSON Body in the right-hand column, or click the button below to download a sample CSV input file.
Request
Section link for Requestcurl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: text/csv" \
--data-binary @"C:\Vault\Roles\assign_object_record_roles.csv" \
https://myvault.veevavault.com/api/v19.3/vobjects/campaign__c/rolesResponse
Section link for Response{
"responseStatus": "SUCCESS",
"data": [
{
"responseStatus": "SUCCESS",
"data": {
"id": "OBE000000000412"
}
}
]
}Example JSON Body
Section link for Example JSON Body[
{
"id": "OBE000000000412",
"roles": [
{
"role": "content_creator__c",
"users": "61590"
}
]
}
]Response Details
Section link for Response DetailsOn SUCCESS, The response includes the object record id.