openapi: 3.2.0 info: version: 1.0.0 title: User Roles API description: API for User Service termsOfService: https://www.moogsoft.com/legal-information/express-terms-conditions/ contact: name: API Support url: https://docs.moogsoft.com/en/moogsoft-apis.html email: support@moogsoft.com license: url: https://www.moogsoft.com/legal-information name: Apex AIOps Incident Management Proprietary servers: - url: https://api.moogsoft.ai - url: https://api.dev.moogsoft.cloud security: - ApiKeyAuth: [] tags: - name: Roles description: Endpoints relating to user roles paths: /v1/roles: get: tags: - Roles summary: Get all roles in the system description: Get all roles currently defined in the system operationId: getRoles responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/MoogResponseListOfRoleDto' '400': description: Invalid parameters or data validation violation content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' '404': description: Requested object(s) not found content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' 4XX: description: Authorization or other error content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' 5XX: description: Error content: application/json: schema: $ref: '#/components/schemas/MoogErrorResponse' security: - ApiKeyAuth: [] servers: - url: https://api.moogsoft.ai - url: https://api.dev.moogsoft.cloud x-permissions: value: - user:no-access description: Required user permissions for this endpoint post: tags: - Roles summary: Create a new roles in the system description: Create a new role in the system operationId: postRoles requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BaseRoleDto' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/MoogResponseRoleDto' '400': description: Bad Request '404': description: Requested object(s) not found content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' 4XX: description: Authorization or other error content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' 5XX: description: Error content: application/json: schema: $ref: '#/components/schemas/MoogErrorResponse' security: - ApiKeyAuth: [] servers: - url: https://api.moogsoft.ai - url: https://api.dev.moogsoft.cloud x-permissions: value: - user:edit description: Required user permissions for this endpoint /v1/roles/{id}: patch: tags: - Roles summary: Update a role in the system description: Update an existing role in the system operationId: patchRoles parameters: - name: id in: path description: ID of the role required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BaseRoleDto' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/MoogResponseRoleDto' '400': description: Invalid parameters or data validation violation content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' '404': description: Requested object(s) not found content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' 4XX: description: Authorization or other error content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' 5XX: description: Error content: application/json: schema: $ref: '#/components/schemas/MoogErrorResponse' security: - ApiKeyAuth: [] servers: - url: https://api.moogsoft.ai - url: https://api.dev.moogsoft.cloud x-permissions: value: - user:edit description: Required user permissions for this endpoint get: tags: - Roles summary: Get specific role details description: Get details for a specific role operationId: getRole parameters: - name: id in: path description: ID of the role required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/MoogResponseRoleDto' '400': description: Invalid parameters or data validation violation content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' '404': description: Requested object(s) not found content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' 4XX: description: Authorization or other error content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' 5XX: description: Error content: application/json: schema: $ref: '#/components/schemas/MoogErrorResponse' security: - ApiKeyAuth: [] servers: - url: https://api.moogsoft.ai - url: https://api.dev.moogsoft.cloud x-permissions: value: - user:view description: Required user permissions for this endpoint delete: tags: - Roles summary: Delete a custom role in the system description: Delete a role already in the system. operationId: deleteRole parameters: - name: id in: path description: ID of the role required: true schema: type: string responses: '204': description: No Content '400': description: Invalid parameters or data validation violation content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' '404': description: Requested object(s) not found content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' 4XX: description: Authorization or other error content: application/json: schema: $ref: '#/components/schemas/MoogFailureResponse' 5XX: description: Error content: application/json: schema: $ref: '#/components/schemas/MoogErrorResponse' security: - ApiKeyAuth: [] servers: - url: https://api.moogsoft.ai - url: https://api.dev.moogsoft.cloud x-permissions: value: - user:edit description: Required user permissions for this endpoint components: schemas: Instant: type: number title: Instant format: int64 examples: - '2022-03-10T16:15:50Z' MoogErrorResponse: type: object description: User API error response body properties: status: type: string description: Error status indicator (always "error") examples: - error message: type: string additional: type: array items: type: string required: - status - message MoogResponseListOfRoleDto: type: object description: User API RoleDto response body properties: status: type: string description: Success status indicator (always "success") examples: - success data: type: array items: $ref: '#/components/schemas/RoleDto' required: - status - data MoogFailureResponse: type: object description: User API failure response body properties: status: type: string description: Failure status indicator (always "failure") examples: - failure message: type: string additional: type: array items: type: string required: - status - message RoleDto: type: object title: Role Dto properties: name: type: string pattern: ^[a-zA-Z0-9.&()_\-\s]+$ minLength: 1 maxLength: 127 description: type: string permissionsAsString: type: array items: type: string minLength: 1 id: type: string created: $ref: '#/components/schemas/Instant' createdBy: type: string lastModified: $ref: '#/components/schemas/Instant' lastModifiedBy: type: string required: - name MoogResponseRoleDto: type: object description: User API RoleDto response body properties: status: type: string description: Success status indicator (always "success") examples: - success data: $ref: '#/components/schemas/RoleDto' required: - status - data BaseRoleDto: type: object title: Base Role Dto properties: name: type: string pattern: ^[a-zA-Z0-9.&()_\-\s]+$ minLength: 1 maxLength: 127 description: type: string permissionsAsString: type: array items: type: string minLength: 1 required: - name securitySchemes: ApiKeyAuth: type: apiKey description: API Key for accessing User API name: apiKey in: header externalDocs: url: https://docs.moogsoft.com/en/moogsoft-apis.html description: Find out more about Apex AIOps Incident Management