Skip to main content

Roles

Information pertaining to retrieving, creating, editing, and deleting roles. Admin permissions and Team feature required.

Link to documentation

List all roles

Returns a list of roles in the account. The roles are returned sorted by creation date, with the most recently created roles appearing first.

The response contains an object with a roles property that contains an array of up to per_page roles. Each entry in the array is a separate role object. If no more roles are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your roles.

Link to documentation

hrvst roles list
OptionDescriptionRequired
--pageThe page number to use in pagination. Use all to retrieve all pages.false
--per_pageThe number of records to return per page. Can range between 1 and 2000.false
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Retrieve a specific role

Retrieves the role with the given ID. Returns a role object and a 200 OK response code if a valid identifier was provided.

Link to documentation

hrvst roles get
OptionDescriptionRequired
--role_idThe ID of the role you're retrieving.true
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Create a role

Creates a new role object. Returns a role object and a 201 Created response code if the call succeeded.

Link to documentation

hrvst roles create
OptionDescriptionRequired
--nametrue
--user_ids[]The IDs of the users assigned to this role.false
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Update a role

Updates the specific role by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a role object and a 200 OK response code if the call succeeded.

Link to documentation

hrvst roles update
OptionDescriptionRequired
--role_idThe ID of the role you're updating.true
--nameThe name of the role.false
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Delete a role

Delete a role. Deleting a role will unlink it from any users it was assigned to. Returns a 200 OK response code if the call succeeded.

Link to documentation

hrvst roles delete
OptionDescriptionRequired
--role_idThe ID of the role you're updating.true
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse