**Source URL:** https://limited.veevavault.dev/regulatory/vault-api/api-reference/24.2/vault-objects/object-roles/assign-users-groups-to-roles-on-object-records.md

# 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](/vault-api/references/csv-rfc-deviations).

* The maximum batch size is 500.

Assigning 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.

<Endpoint path="/api/{version}/vobjects/{object_name}/roles" method="POST"></Endpoint>

## Headers {#headers}

<FieldTable>
| Name | Description |
| --- | --- |
| `Content-Type` | `text/csv` or `application/json` |
| `Accept` | `application/json` (default), `text/csv`, or `application/xml` |
</FieldTable>

## URI Path Parameters {#uri-path-parameters}

<FieldTable>
| Name | Description |
| --- | --- |
| `{object_name}` | The name of the object where you want to update records. |
</FieldTable>

## Body Parameters {#body-parameters}

Prepare a JSON or CSV input file. User and group assignments are ignored if they are invalid, inactive, or already exist.

<FieldTable>
| 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 group `id` values for the new role. |
</FieldTable>
See Example JSON Request Body in the right-hand column, or click the button below to download a sample CSV input file.

<DownloadButton href="/sample-files/vault_assign_object_record_roles.csv" label="Download Input File"></DownloadButton>

## Request {#request}

<CodeExample title="">
```
curl -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/v17.2/vobjects/campaign__c/roles

```
</CodeExample>

## Response {#response}

<CodeExample title="">
```
{
    "responseStatus": "SUCCESS",
    "data": [
        {
            "responseStatus": "SUCCESS",
            "data": {
                "id": "OBE000000000412"
            }
        }
    ]
}

```
</CodeExample>

## Example JSON Request Body {#example-json-request-body}

<CodeExample title="">
```
[
  {
    "id": "OBE000000000412",
    "roles": [
      {
        "role": "content_creator__c",
        "users": "61590"
      }
      ]
  }
]

```
</CodeExample>

## Response Details {#response-details}

On `SUCCESS`, The response includes the object record `id`.



---

**Previous:** [Retrieve Object Record Roles](/regulatory/vault-api/api-reference/24.2/vault-objects/object-roles/retrieve-object-record-roles)  
**Next:** [Remove Users & Groups from Roles on Object Records](/regulatory/vault-api/api-reference/24.2/vault-objects/object-roles/remove-users-groups-from-roles-on-object-records)