--- title: "Department Actions" slug: "department-actions" description: "This is a list of Department Actions in the Org category that can be used by RapidIdentity Connect to interact with Department data for RapidIdentity Studio." tags: ["RapidIdentity ", "Connect", "Actions", "Department", "Org"] updated: 2022-06-03T19:19:50Z published: 2022-06-03T19:19:50Z canonical: "help.rapididentity.com/department-actions" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.rapididentity.com/llms.txt > Use this file to discover all available pages before exploring further. # Department Actions ### getDepartment Retrieves a Department. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the Department | ```actionscript department = saveDepartment({"name": "Math", "code": "765", "description": "Math Department"}) department = getDepartment(department.id) ``` ### getAllDepartments Retrieves all Departments. ***Note:*** *If there is no department ID yet in the system, RapidIdentity will create one using a createDepartment Action.* | Property | Value | Description | | --- | --- | --- | | pageSize | integer | The page size (required for a paging request) | | pageNum | integer | The page number (defaults to 1 for a paging request) | ```actionscript saveDepartment({"name": "Math", "code": "765", "description": "Math Department"}) departments = getAllDepartments() ``` ### saveDepartment Updates a Department. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the Department | ```actionscript saveDepartment({"name": "Math", "code": "765", "description": "Math Department"}) ``` ### getDepartmentRelationship Retrieves just one Department Relationship. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the Department Relationship | ```actionscript department = saveDepartment({"name": "Math", "code": "765", "description": "Math Department"}) departmentRelationship = saveDepartmentRelationship({"departmentId": department.id, "userId":, "role": "ADMINISTRATOR"}) departmentRel = getDepartmentRelationShip(departmentRelationship.id) ``` ### getAllDepartmentRelationships Retrieves all Department Relationships. If no relationship IDs have yet been defined, RapidIdentity will create one using a createDepartmentRelationship Action Set. | Property | Value | Description | | --- | --- | --- | | departmentId | string | The department ID for which to fetch department relationships | | userId | string | The user ID for which to fetch department relationships | | role | string | The role for which to fetch department relationships | | pageSize | integer | The page size (required for a paging request) | | pageNum | integer | The page number (defaults to 1 for a paging request) | ```actionscript department = saveDepartment({"name": "Math", "code": "765", "description": "Math Department"}) saveDepartmentRelationship({"departmentId": department.id, "userId":, "role": "ADMINISTRATOR"}) departments = getAllDepartmentRelationships() ``` ### saveDepartmentRelationship Updates a Department Relationship. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the Department Relationship | ```actionscript department = saveDepartment({"name": "Math", "code": "765", "description": "Math Department"}) saveDepartmentRelationship({"departmentId": department.id, "userId":, "role": "ADMINISTRATOR"}) ``` ### deleteDepartmentRelationship Deletes a Department Relationship. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the Department Relationship | Delete by Department Relationship id. ### deleteDepartment Deletes a department. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the department to be deleted | Delete by Department id.