openapi: 3.0.0 info: title: Learn Rest Api assignments department API version: '3.0' description: Assignment operations servers: - url: https://api-learn.ispring.com description: Main server security: - bearerAuth: [] tags: - name: department description: Department operations paths: /department: get: tags: - department summary: Get department list operationId: GetDepartments parameters: - name: code in: query required: false schema: type: string responses: '200': description: Success Response content: application/json: schema: required: - departments properties: departments: type: array items: $ref: '#/components/schemas/Department' type: object application/xml: schema: required: - departments properties: departments: type: array items: $ref: '#/components/schemas/Department' type: object xml: name: response wrapped: true '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/PermissionDenied' post: tags: - department summary: Add a new department operationId: AddDepartment parameters: - $ref: '#/components/parameters/returnObject' - name: X-Name in: header required: false schema: type: string - name: X-Parent-Department-Id in: header required: false schema: type: string format: uuid - name: X-Code in: header required: false schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/NewDepartment' application/xml: schema: $ref: '#/components/schemas/NewDepartment' responses: '201': description: Created content: application/json: schema: description: The department ID type: string format: uuid application/xml: schema: description: The department ID type: string format: uuid xml: name: response '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/PermissionDenied' /department/{departmentId}: get: tags: - department summary: Get department info operationId: GetDepartment parameters: - name: departmentId in: path required: true schema: type: string responses: '200': description: Success Response content: application/json: schema: properties: response: $ref: '#/components/schemas/Department' type: object application/xml: schema: properties: response: $ref: '#/components/schemas/Department' type: object '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/PermissionDenied' post: tags: - department summary: Update department operationId: UpdateDepartment parameters: - name: departmentId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateDepartment' application/xml: schema: $ref: '#/components/schemas/UpdateDepartment' responses: '204': description: No Content '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/PermissionDenied' delete: tags: - department summary: Delete department operationId: RemoveDepartment parameters: - name: departmentId in: path required: true schema: type: string responses: '204': description: Successful operation '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/PermissionDenied' /department/{departmentId}/subordination: post: tags: - department summary: Change department subordination operationId: ChangeDepartmentSubordination parameters: - name: departmentId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ChangeDepartmentSubordination' application/xml: schema: $ref: '#/components/schemas/ChangeDepartmentSubordination' responses: '204': description: Successful operation '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/PermissionDenied' /department/{departmentId}/user/move: post: tags: - department summary: Move users to department operationId: MoveUsersToDepartment parameters: - name: departmentId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/MoveUsersToDepartment' application/xml: schema: $ref: '#/components/schemas/MoveUsersToDepartment' responses: '204': description: Successful operation '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/PermissionDenied' '404': $ref: '#/components/responses/NotFound' /department/{parentId}/department/move: post: tags: - department summary: Move departments to parent department operationId: MoveDepartments parameters: - name: parentId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/MoveDepartments' application/xml: schema: $ref: '#/components/schemas/MoveDepartments' responses: '204': description: Successful operation '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/PermissionDenied' '404': $ref: '#/components/responses/NotFound' components: schemas: Subordination: required: - subordinationType properties: subordinationType: type: string enum: - manual - inherit - no_supervisor supervisorId: type: string type: object ChangeDepartmentSubordination: properties: subordination: $ref: '#/components/schemas/Subordination' coSubordination: $ref: '#/components/schemas/Subordination' type: object xml: name: request MoveUsersToDepartment: required: - userIds properties: userIds: $ref: '#/components/schemas/ArrayOfIds' type: object xml: name: request ErrorResponse: required: - code - message properties: code: type: integer message: type: string type: object xml: name: response ArrayOfIds: type: array items: type: string format: uuid xml: name: id xml: wrapped: true NewDepartment: required: - name - parentDepartmentId properties: name: type: string parentDepartmentId: type: string format: uuid code: type: string type: object xml: name: request UpdateDepartment: properties: name: type: string parentDepartmentId: type: string format: uuid code: type: string type: object xml: name: request Department: required: - departmentId - name - subordination - coSubordination properties: departmentId: type: string format: uuid name: type: string parentDepartmentId: type: string format: uuid code: type: string subordination: $ref: '#/components/schemas/Subordination' coSubordination: $ref: '#/components/schemas/Subordination' type: object xml: name: department MoveDepartments: required: - departmnetIds properties: departmentIds: $ref: '#/components/schemas/ArrayOfIds' type: object xml: name: request responses: PermissionDenied: description: Permission Denied content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' application/xml: schema: $ref: '#/components/schemas/ErrorResponse' Unauthorized: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' application/xml: schema: $ref: '#/components/schemas/ErrorResponse' NotFound: description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' application/xml: schema: $ref: '#/components/schemas/ErrorResponse' BadRequest: description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' application/xml: schema: $ref: '#/components/schemas/ErrorResponse' parameters: returnObject: name: X-Return-Object in: header required: false schema: type: boolean securitySchemes: bearerAuth: type: http scheme: bearer