Skip to content

Retrieve all available roles on a document and the users and groups assigned to them.

GET/api/{version}/objects/documents/{doc_id}/roles
NameDescription
Acceptapplication/json (default) or application/xml
NameDescription
{doc_id}The document id field value.
curl -X GET -H "Authorization: {SESSION_ID}" \ https://myvault.veevavault.com/api/v26.1/objects/documents/245/roles
{ "responseStatus": "SUCCESS", "responseMessage": "Document roles retrieved", "errorCodes": null, "documentRoles": [ { "name": "reviewer__v", "label": "Reviewer", "assignedUsers": [ 25496, 26231 ], "assignedGroups": [ 1, 2 ], "availableUsers": [ 25496, 26231, 28874 ], "availableGroups": [ 1, 2, 3 ], "defaultUsers": [ 25496, 26231 ], "defaultGroups": [ 1, 2 ] } ], "errorType": null }

On SUCCESS, the response lists all document roles and includes the following for each role:

NameDescription
nameThe role name available to developers. For example, reviewer__v.
labelThe UI-friendly role label available to Admins in the Vault UI. For example, Reviewer.
assignedUsersList of the IDs of users assigned to this role
assignedGroupsList of the IDs of groups assigned to this role
availableUsersList of the IDs of users available for this role
availableGroupsList of the IDs of groups available to this role
defaultUsersList of the IDs of default users assigned to this role
defaultGroupsList of the IDs of default groups assigned to this role