openapi: 3.0.1
info:
  title: 'v1-alpha: User process management API'
  description: All user process management operations
  version: '1.0'
servers:
  - url: https://user-proc-mng-platform-sit.apps.cicd2.mdtu-ddm.projects.epam.com/user-process-management
    description: Generated server url
paths:
  /api/grouped-process-definition:
    get:
      tags:
        - process-definition-controller
      summary: Retrieve all process definitions with groups
      description: Returns grouped and ungrouped business process definitions ordered lists
      operationId: getProcessDefinitions
      parameters:
        - name: params
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/GetProcessDefinitionsParams'
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/GroupedProcessDefinitionResponse'
        '403':
          description: Forbidden
          content:
            application/json: {}
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailedErrorResponse'  
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailedErrorResponse'   
        '504':
          description: Request timed out
          content:
            application/json: {}                                            
components:
  schemas:
    GetProcessDefinitionsParams:
      type: object
      properties:
        active:
          type: boolean
        suspended:
          type: boolean
    ProcessDefinitionResponse:
      type: object
      properties:
        id:
          type: string
        key:
          type: string
        name:
          type: string
        suspended:
          type: boolean
        formKey:
          type: string
    GroupedProcessDefinitionResponse:
      type: object
      properties:
        groups:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              processDefinitions:
                type: array
                items:
                  $ref: '#/components/schemas/ProcessDefinitionResponse'
        ungrouped:
          type: array
          items:
            $ref: '#/components/schemas/ProcessDefinitionResponse'
    DetailedErrorResponse:
      type: object
      properties:
        traceId:
          type: string
        type:
          type: string
        message:
          type: string
        localizedMessage:
          type: string            