openapi: "3.0.1"
info:
  title: Midaxo Cloud REST API
  version: "1.3"
  description: |
    The Midaxo Cloud REST API is a RESTful API that allows you to interact with the Midaxo Cloud platform.
  termsOfService: https://www.midaxo.com/customer-terms-of-service
  contact:
    name: Midaxo Cloud Support
    url: https://www.midaxo.com/support
  license: Commercial - see Terms of Service
paths:
  /processes:
    get:
      summary: "Get list of processes in workspace"
      responses:
        "200":
          description: "Successfuly get list of processes"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Processes"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
        "413":
          description: "Request entity too large. Use pagination to reduce the response size"
  /processes/{processId}/coverpage:
    get:
      summary: "Get Coverpage structure for process"
      responses:
        "200":
          description: "Successful Coverpage structure"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CoverpageStructure"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
        "413":
          description: "Request entity too large. Use pagination to reduce the response size"
    parameters:
      - $ref: "#/components/parameters/processIdParam"
  /processes/{processId}/stages:
    get:
      summary: "Get list of Stages for process"
      responses:
        "200":
          description: "Successful get list of Stages"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Stages"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
        "413":
          description: "Request entity too large. Use pagination to reduce the response size"
    parameters:
      - $ref: "#/components/parameters/processIdParam"
  /processes/{processId}/projects:
    get:
      summary: "Get list of projects in process including all fields"
      responses:
        "200":
          description: "Successful get list of projects"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Projects"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
        "413":
          description: "Request entity too large. Use pagination to reduce the response size"
    parameters:
      - $ref: "#/components/parameters/processIdParam"
  /processes/{processId}/projects/ids:
    get:
      summary: "Get a list of project ids in a process"
      responses:
        "200":
          description: "Successful get a list of project ids"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProjectIds"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "404":
          description: "Process not found"
        "413":
          description: "Request entity too large. Use pagination to reduce the response size"
    parameters:
      - $ref: "#/components/parameters/processIdParam"
  /processes/{processId}/projects/{projectId}/activities:
    get:
      summary: "Get Touchpoints activities for project"
      responses:
        "200":
          description: "Successful get Touchpoints activities"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Activities"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
        "413":
          description: "Request entity too large. Use pagination to reduce the response size"
    parameters:
      - $ref: "#/components/parameters/processIdParam"
      - $ref: "#/components/parameters/projectIdParam"
  /processes/{processId}/projects/{projectId}/issues:
    get:
      summary: "Get Issues by project"
      responses:
        "200":
          description: "Successful get Issues"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Issues"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
        "413":
          description: "Request entity too large. Use pagination to reduce the response size"
    parameters:
      - $ref: "#/components/parameters/processIdParam"
      - $ref: "#/components/parameters/projectIdParam"
  /processes/{processId}/projects/{projectId}/tasks:
    get:
      summary: "Get Tasks for project"
      responses:
        "200":
          description: "Successful get Tasks"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Tasks"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
        "413":
          description: "Request entity too large. Use pagination to reduce the response size"
    parameters:
      - $ref: "#/components/parameters/processIdParam"
      - $ref: "#/components/parameters/projectIdParam"
  /value-tracker/{projectId}/initiatives:
    get:
      summary: "Get list of initiatives in a project"
      responses:
        "200":
          description: "Successful get list of initiatives"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Projects"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
    parameters:
      - $ref: "#/components/parameters/projectIdParam"
  /value-tracker/{projectId}/kpis:
    get:
      summary: "Get list of kpis in a project"
      responses:
        "200":
          description: "Successful get list of kpis for value tracker"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Projects"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
    parameters:
      - $ref: "#/components/parameters/projectIdParam"
  /value-tracker/{projectId}/metrics:
    get:
      summary: "Get list of metrics in a project"
      responses:
        "200":
          description: "Successful get list of metrics for value tracker"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Projects"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
    parameters:
      - $ref: "#/components/parameters/projectIdParam"
  /value-tracker/{projectId}/tasks/{taskId}/initiatives:
    get:
      summary: "Get list of initiatives in a project for a given task"
      responses:
        "200":
          description: "Successful get list of initiatives for a task"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Projects"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
    parameters:
      - $ref: "#/components/parameters/projectIdParam"
      - $ref: "#/components/parameters/taskIdParam"
  /value-tracker/{projectId}/initiatives/{initiativeId}/datapoints:
    get:
      summary: "Get list of datapoints in an initiative"
      responses:
        "200":
          description: "Successful get datapoints for an initiative"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Projects"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
    parameters:
      - $ref: "#/components/parameters/projectIdParam"
      - $ref: "#/components/parameters/initiativeIdParam"
  /value-tracker/{projectId}/initiatives/{initiativeId}/datapoints/topdownplanned:
    get:
      summary: "Get list of datapoints topdownplanned for an initiative"
      responses:
        "200":
          description: "Successful get list of datapoints topdownplanned"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Projects"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "Entity not found"
    parameters:
      - $ref: "#/components/parameters/projectIdParam"
      - $ref: "#/components/parameters/initiativeIdParam"
  /users:
    get:
      summary: "Get list of users in workspace"
      parameters:
        - in: query
          name: first
          description: "Page size, the maximum number of users in one response"
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - in: query
          name: after
          description: "Opaque cursor of the last user on the previous page"
          schema:
            type: string
      responses:
        "200":
          description: "Successfully get list of users"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Users"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "413":
          description: "Request entity too large. Use pagination to reduce the response size"
  /users/{userId}:
    get:
      summary: "Get a single user by their ID"
      parameters:
        - $ref: "#/components/parameters/userIdParam"
      responses:
        "200":
          description: "Successfully get user"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "401":
          description: "Unauthorized. Check your access token validity and that it has the correct audience"
        "403":
          description: "Forbidden. You do not have permissions to access the resource"
        "404":
          description: "User not found"
  /processes/{processId}/auditlog:
    get:
      summary: "Get audit log entries for process"
      parameters:
        - in: query
          name: first
          description: "Page size, the maximum number of audit log entries in one response"
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 64
        - in: query
          name: after
          description: "Opaque cursor of the last audit log entry on the previous page"
          schema:
            type: string
        - in: query
          name: taskIds
          description: "Filter by task IDs"
          schema:
            type: array
            items:
              type: string
              format: uuid
          style: form
          explode: true
        - in: query
          name: projectIds
          description: "Filter by project IDs"
          schema:
            type: array
            items:
              type: string
              format: uuid
          style: form
          explode: true
        - in: query
          name: actorIds
          description: "Filter by actor IDs"
          schema:
            type: array
            items:
              type: string
              format: uuid
          style: form
          explode: true
        - in: query
          name: issueIds
          description: "Filter by issue IDs"
          schema:
            type: array
            items:
              type: string
              format: uuid
          style: form
          explode: true
        - in: query
          name: coverpagefieldIds
          description: "Filter by coverpage field IDs"
          schema:
            type: array
            items:
              type: string
              format: uuid
          style: form
          explode: true
        - in: query
          name: entityType
          description: "Filter by entity type"
          schema:
            $ref: "#/components/schemas/AuditLogEntityType"
        - in: query
          name: actionTypes
          description: "Filter by action types"
          schema:
            type: array
            items:
              $ref: "#/components/schemas/AuditLogActionType"
          style: form
          explode: true
        - in: query
          name: startTime
          description: "Filter entries created after this timestamp"
          schema:
            type: string
            format: date-time
        - in: query
          name: endTime
          description: "Filter entries created before this timestamp"
          schema:
            type: string
            format: date-time
        - in: query
          name: aiGenerated
          description: "Filter by AI generated flag"
          schema:
            type: boolean
      responses:
        "200":
          description: "Successful get audit log entries"
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AuditLogEntries"
        "400":
          description: "Bad request. Some input parameters are malformed"
        "404":
          description: "Entity not found"
    parameters:
      - $ref: "#/components/parameters/processIdParam"
x-amazon-apigateway-cors:
  allowOrigins: "'*'"
  allowHeaders: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key'"
  allowMethods: "'*'"
components:
  schemas:
    Process:
      type: object
      description: |
        Represents a business process or workflow in Midaxo Cloud.
        A process contains multiple projects and defines the overall structure for managing deals, M&A activities, or other business initiatives.
      properties:
        processId:
          type: string
          format: uuid
          description: "Unique identifier for the process"
        name:
          type: string
          description: "Human-readable name of the process"
    Processes:
      type: object
      description: "Container for a list of processes accessible in the current workspace"
      properties:
        processes:
          type: array
          description: "Array of process objects"
          items:
            $ref: "#/components/schemas/Process"
    Stage:
      type: object
      description: "Represents a stage within a process workflow. Stages define the sequential steps that projects move through, such as 'Initial Review', 'Due Diligence', 'Negotiation', etc."
      properties:
        processId:
          type: string
          format: uuid
          description: "ID for the Process that the Stage belongs to"
        stageId:
          type: string
          description: "Unique identifier for the stage within the process"
        name:
          type: string
          description: "Display name for the stage (e.g., 'Due Diligence', 'Contract Negotiation')"
        ordinalNumber:
          type: integer
          minimum: 0
          description: "Sequential order of this stage within the process workflow (0-based)"
    Stages:
      type: object
      description: "Container for all stages within a specific process, returned in ordinal order"
      properties:
        stages:
          type: array
          description: "Array of stage objects ordered by their ordinalNumber"
          items:
            $ref: "#/components/schemas/Stage"
    ProjectIds:
      type: object
      description: "Lightweight response containing only project identifiers, useful for operations that need to iterate over projects without fetching full project data"
      properties:
        projectIds:
          type: array
          description: "Array of unique project identifiers"
          items:
            type: string
            format: uuid
            description: "UUID of a project"
    Projects:
      type: object
      description: "Paginated container for project data, including both project information and pagination metadata for handling large result sets"
      properties:
        projects:
          type: array
          description: "Array of project objects with complete field data"
          items:
            $ref: "#/components/schemas/Project"
        paging:
          $ref: "#/components/schemas/Paging"
    Project:
      description: "Complete project entity combining property fields, insight data, and dynamic custom fields. Projects represent individual deals, transactions, or initiatives being tracked within a process."
      allOf:
        - $ref: "#/components/schemas/ProjectPropertyFields"
        - $ref: "#/components/schemas/ProjectInsightFields"
        - type: object
          properties:
            processId:
              type: string
              format: uuid
              description: "ID for the Process that the Project belongs to"
            stageId:
              type: string
              format: uuid
              description: "ID for the current Stage that the Project is in within the process workflow"
            dealScore:
              type: string
              description: "Calculated deal score based on weighted scoring criteria defined in the process"
            dealScores:
              description: "Individual field scores that contribute to the overall deal score. Key represents field ID, value represents the calculated score for that field."
              type: object
              additionalProperties:
                $ref: "#/components/schemas/ScoreValue"
          additionalProperties:
            description: "Dynamic custom fields specific to the process. Field IDs serve as keys, with values conforming to ProjectFieldValue schema."
            $ref: "#/components/schemas/ProjectFieldValue"
    ProjectPropertyFields:
      description: "Core project properties that are standard across all Midaxo processes, including lifecycle management and metadata fields"
      type: object
      properties:
        projectId:
          type: string
          format: uuid
          description: "Unique identifier for the project"
        archived:
          type: string
          enum: ["No", "Yes"]
          description: "Indicates whether the project has been archived and is no longer active"
        archivedBy:
          type: string
          description: "User identifier of who archived the project"
        archivingReason:
          type: string
          description: "Reason provided when archiving the project"
        archivingTime:
          type: string
          format: date-time
          description: "Timestamp when the project was archived"
        createdDate:
          type: string
          format: date-time
          description: "When the project was first created"
        dueDate:
          type: string
          format: date-time
          description: "Target completion date for the project"
        lastActivityTime:
          type: string
          format: date-time
          description: "Timestamp of the most recent activity (meeting, call, email, etc.) associated with the project"
        lastCommunicationTime:
          type: string
          format: date-time
          description: "Timestamp of the most recent communication activity"
        projectEmail:
          type: string
          format: email
          description: "Dedicated email address for project-related communications"
        projectName:
          type: string
          description: "Display name of the project"
        stageName:
          type: string
          description: "Human-readable name of the current stage (derived from stageId)"
        startDate:
          type: string
          format: date-time
          description: "Project start date"
    ProjectInsightFields:
      type: object
      description: "External company intelligence data automatically enriched by Midaxo Insights, providing market data and company information for the linked company"
      properties:
        insightsAnnualRevenue:
          type: string
          description: "Annual revenue of the target company from external data sources"
        insightsDescription:
          type: string
          description: "Business description of the target company"
        insightsLogo:
          type: string
          format: uri
          description: "URL to the company's logo image"
        insightsEstAnnualRevenue:
          type: string
          description: "Estimated annual revenue when actual data is not available"
        insightsEstHeadcount:
          type: string
          description: "Estimated number of employees"
        insightsEstHeadcountRange:
          type: string
          description: "Employee count range"
        insightsIndustry:
          type: string
          description: "Primary industry classification"
        insightsIndustryGroup:
          type: string
          description: "Industry group classification (broader than industry)"
        insightsIndustrySector:
          type: string
          description: "Sector classification (broader than industry group)"
        insightsLocation:
          type: string
          description: "Primary business location or headquarters"
        insightsMarketCap:
          type: string
          description: "Market capitalization for public companies"
        insightsName:
          type: string
          description: "Official company name from external data sources"
        insightsSubIndustry:
          type: string
          description: "Sub-industry classification (more specific than industry)"
        insightsTags:
          type: array
          description: "Industry tags and categories associated with the company"
          items:
            type: string
        insightsTicker:
          type: string
          description: "Stock ticker symbol for public companies"
        insightsTotalFunding:
          type: string
          description: "Total funding raised (for private companies)"
    ProjectFieldValue:
      description: "Flexible value type for custom project fields, supporting both single values and multi-select arrays"
      oneOf:
        - type: string
          description: "Single text value for single-choice field types"
        - type: array
          description: "Array of values for multi-select fields"
          items:
            type: string
    ScoreValue:
      type: string
      description: "Numeric score value as a string, calculated based on field scoring rules defined in the process configuration"
    Paging:
      type: object
      description: "Cursor-based pagination metadata for navigating through large result sets efficiently"
      properties:
        startCursor:
          type: string
          description: "Cursor pointing to the first item in the current page, used for previous page navigation"
        endCursor:
          type: string
          description: "Cursor pointing to the last item in the current page, used for next page navigation"
    CoverpageStructure:
      type: object
      description: "Defines the structure and layout of a process's coverpage, which displays project fields organized into logical groups. This configuration determines how project information is presented to users."
      properties:
        processId:
          type: string
          format: uuid
          description: "ID for the Process that the CoverpageStructure belongs to"
        groups:
          type: array
          description: "Ordered list of field groups that organize related fields together on the coverpage"
          items:
            $ref: "#/components/schemas/CoverpageGroup"
        archivedFields:
          type: array
          description: "Fields that have been removed from active use but are preserved for historical data"
          items:
            $ref: "#/components/schemas/CoverpageField"
    CoverpageGroup:
      type: object
      description: "A logical grouping of related fields on the coverpage, such as 'Company Information', 'Financial Details', or 'Deal Terms'"
      properties:
        groupId:
          type: string
          description: "Unique identifier for the group within the coverpage"
        header:
          type: string
          description: "Display title for the group shown to users"
        fields:
          type: array
          description: "Fields contained within this group, displayed in the specified order"
          items:
            $ref: "#/components/schemas/CoverpageField"
        hidden:
          type: boolean
          description: "Whether this group is hidden from the coverpage display (but data is still captured)"
    CoverpageField:
      description: "Represents a data field on the coverpage."
      oneOf:
        - $ref: "#/components/schemas/RegularCoverpageField"
        - $ref: "#/components/schemas/ChoiceCoverpageField"
      discriminator:
        propertyName: fieldType
    RegularCoverpageField:
      type: object
      description: "Standard input field for text, numbers, dates, or other simple data types"
      properties:
        fieldId:
          type: string
          description: "Unique identifier for the field"
        externalId:
          type: string
          description: "External system identifier for integration purposes"
        fieldType:
          $ref: "#/components/schemas/RegularCoverpageFieldType"
        title:
          type: string
          description: "Display label shown to users"
        usedInDealScoring:
          type: boolean
          description: "Whether this field contributes to the calculated deal score"
        value:
          type: string
          description: "Current value of the field for the project"
    ChoiceCoverpageField:
      description: "Field that presents users with predefined options to select from"
      allOf:
        - $ref: "#/components/schemas/RegularCoverpageField"
        - type: object
          properties:
            fieldType:
              $ref: "#/components/schemas/ChoiceCoverpageFieldType"
            choices:
              type: array
              description: "Available options for selection, each with optional scoring values"
              items:
                $ref: "#/components/schemas/Choice"
    RegularCoverpageFieldType:
      type: string
      description: "Supported field types for regular input fields"
      enum:
        - DATE_TIME
        - DECIMAL
        - INTEGER
        - LONG_TEXT
        - SHORT_TEXT
        - SOCIAL_CONNECTIONS
    ChoiceCoverpageFieldType:
      type: string
      description: "Supported field types for choice-based fields"
      enum:
        - CHOICE
        - MULTIPLE_CHOICE
    Choice:
      type: object
      description: "Individual option within a choice field, with optional deal scoring value"
      properties:
        choiceId:
          type: string
          format: uuid
          description: "Unique identifier for this choice option"
        label:
          type: string
          maxLength: 400
          description: "Display text shown to users for this option"
        dealScore:
          type: string
          description: "Numeric score assigned to this choice for deal scoring calculations"
    Activities:
      type: object
      description: "Paginated collection of project activities including meetings, calls, emails, and notes that track project engagement and communication history"
      properties:
        activities:
          type: array
          description: "Array of activity objects ordered by recency"
          items:
            $ref: "#/components/schemas/Activity"
        paging:
          $ref: "#/components/schemas/Paging"
    Activity:
      description: "Base activity type representing any project interaction"
      oneOf:
        - $ref: "#/components/schemas/Call"
        - $ref: "#/components/schemas/Meeting"
        - $ref: "#/components/schemas/Note"
        - $ref: "#/components/schemas/InboundEmail"
      discriminator:
        propertyName: type
    BasicActivity:
      type: object
      description: "Common properties shared by all activity types"
      properties:
        projectId:
          type: string
          format: uuid
          description: "ID for the Project that the Activity belongs to"
        id:
          type: string
          format: uuid
          description: "Unique identifier for the activity"
        type:
          type: string
          enum:
            - CALL
            - COMMENT
            - EMAIL_INBOUND
            - MEETING
            - NOTE
          description: "Activity type"
        createdBy:
          type: string
          description: "User ID of the user who created this activity record. References the User entity."
        updatedBy:
          type: string
          description: "User ID of the user who last modified this activity. References the User entity."
        created:
          type: string
          format: date-time
          description: "Timestamp when the activity was created"
        updated:
          type: string
          format: date-time
          description: "Timestamp when the activity was last updated"
        replyCount:
          type: number
          minimum: 0
          description: "Number of replies or follow-up comments on this activity"
        keywords:
          type: array
          description: "Extracted keywords for content analysis and search"
          items:
            type: string
        mentions:
          type: array
          description: "People or entities mentioned in the activity content"
          items:
            type: string
        tags:
          type: array
          description: "Categorization tags applied to this activity"
          items:
            $ref: "#/components/schemas/ActivityTag"
    Call:
      description: "Phone call activity with duration tracking and call notes"
      allOf:
        - $ref: "#/components/schemas/BasicActivity"
        - type: object
          properties:
            type:
              type: string
              enum: [CALL]
            subject:
              type: string
              description: "Call purpose or agenda"
            message:
              type: string
              description: "Call notes and discussion summary"
            startTime:
              type: string
              format: date-time
              description: "When the call began"
            duration:
              type: integer
              minimum: 0
              maximum: 1440
              description: "Call duration in minutes"
    Meeting:
      description: "In-person or virtual meeting activity with location and duration details"
      allOf:
        - $ref: "#/components/schemas/BasicActivity"
        - type: object
          properties:
            type:
              type: string
              enum: [MEETING]
            subject:
              type: string
              description: "Meeting title or agenda"
            message:
              type: string
              description: "Meeting notes and outcomes"
            startTime:
              type: string
              format: date-time
              description: "Scheduled meeting start time"
            duration:
              type: integer
              minimum: 0
              maximum: 1440
              description: "Meeting duration in minutes"
            location:
              type: string
              description: "Meeting location or virtual meeting platform"
    Note:
      description: "General note or observation related to the project"
      allOf:
        - $ref: "#/components/schemas/BasicActivity"
        - type: object
          properties:
            type:
              type: string
              enum: [NOTE]
            message:
              type: string
              description: "Note content and observations"
    InboundEmail:
      description: "Email forwarded to the project's email address"
      allOf:
        - $ref: "#/components/schemas/BasicActivity"
        - type: object
          properties:
            type:
              type: string
              enum: [EMAIL_INBOUND]
            subject:
              type: string
              description: "Email subject line"
            message:
              type: string
              description: "Email body content"
            emailFrom:
              type: string
              format: email
              description: "Sender's email address"
            emailTo:
              type: array
              description: "Primary recipients"
              items:
                type: string
                format: email
            emailCc:
              type: array
              description: "CC recipients"
              items:
                type: string
                format: email
            externalId:
              type: string
              nullable: true
              description: "External email system identifier for the email message"
            sentTime:
              type: string
              format: date-time
              description: "When the email was sent"
    ActivityTag:
      type: object
      description: "Categorization tag that can reference contacts, projects, users, or be a free-form text label"
      properties:
        tagType:
          type: string
          enum:
            - CONTACT
            - PROJECT
            - TEXT
            - USER
          description: "Type of entity this tag references"
        label:
          type: string
          description: "Display text for the tag"
        tooltip:
          type: string
          nullable: true
          description: "Additional context shown on hover (optional)"
        originId:
          type: string
          description: "ID of the referenced entity (contact ID, project ID, user ID, etc.)"
    Tasks:
      type: object
      description: "Collection of project tasks representing work items, deliverables, or milestones that need to be completed"
      properties:
        tasks:
          type: array
          description: "Array of task objects, typically ordered by hierarchy and sequence"
          items:
            $ref: "#/components/schemas/Task"
    Task:
      type: object
      description: "Individual work item or milestone within a project, supporting hierarchical organization and progress tracking"
      properties:
        projectId:
          type: string
          format: uuid
          description: "ID for the Project that the Task belongs to"
        taskId:
          type: string
          format: uuid
          description: "Unique identifier for the task"
        title:
          type: string
          maxLength: 255
          description: "Task name or title"
        status:
          type: string
          enum:
            - NOT_STARTED
            - UPCOMING
            - IN_PROGRESS
            - AT_RISK
            - DELAYED
            - FURTHER_ACTION_REQUIRED
            - READY_FOR_REVIEW
            - COMPLETED
            - POSTPONED
            - GUIDANCE
            - NOT_APPLICABLE
            - IGNORED
            - OTHER
          description: "Current status"
        summary:
          type: string
          maxLength: 1024
          description: "Brief description of the task"
        startDate:
          type: string
          format: date-time
          description: "Planned or actual start date"
        dueDate:
          type: string
          format: date-time
          description: "Target completion date"
        completedDate:
          type: string
          format: date-time
          description: "Actual completion date (if completed)"
        notes:
          type: string
          description: "Additional notes and context"
        guide:
          type: string
          description: "Instructions or guidance for completing the task"
        documentCount:
          type: string
          description: "Number of documents associated with this task"
        commentCount:
          type: string
          description: "Number of comments on this task"
        index:
          type: string
          description: "Task ordering index within its level"
        level:
          type: number
          minimum: 1
          maximum: 10
          description: "Hierarchical depth (1 = top level, 2 = sub-task, etc.)"
        level1:
          type: string
          description: "Top-level task identifier"
        level2:
          type: string
          nullable: true
          description: "Second-level task identifier (if applicable)"
        level3:
          type: string
          nullable: true
          description: "Third-level task identifier (if applicable)"
        level4:
          type: string
          nullable: true
          description: "Fourth-level task identifier (if applicable)"
        level5:
          type: string
          nullable: true
          description: "Fifth-level task identifier (if applicable)"
        level6:
          type: string
          nullable: true
          description: "Sixth-level task identifier (if applicable)"
        level7:
          type: string
          nullable: true
          description: "Seventh-level task identifier (if applicable)"
        level8:
          type: string
          nullable: true
          description: "Eighth-level task identifier (if applicable)"
        level9:
          type: string
          nullable: true
          description: "Ninth-level task identifier (if applicable)"
        level10:
          type: string
          nullable: true
          description: "Tenth-level task identifier (if applicable)"
        responsible_ids:
          type: array
          description: Array of identifiers for the people assigned to this task"
          items:
            type: string
            format: uuid
    Issues:
      type: object
      description: "Collection of project issues representing risks, problems, or concerns that need to be tracked and resolved"
      properties:
        issues:
          type: array
          description: "Array of issue objects, typically ordered by severity or creation date"
          items:
            $ref: "#/components/schemas/Issue"
    Issue:
      type: object
      description: "Risk, problem, or concern identified within a project that requires tracking and resolution"
      properties:
        projectId:
          type: string
          format: uuid
          description: "ID for the Project that the Issue belongs to"
        issueId:
          type: string
          format: uuid
          description: "Unique identifier for the issue"
        issueType:
          type: string
          description: "Type of issue (risk, assumption, etc.)"
          enum:
            - ASSUMPTION
            - DEPENDENCY
            - ISSUE
            - ENQUIRY
            - RISK
        title:
          type: string
          maxLength: 256
          description: "Issue summary or title"
        status:
          type: string
          enum:
            - IDENTIFIED
            - IN_PROGRESS
            - IN_REVIEW
            - MONITORING
            - DEAL_BREAKER
            - REJECTED
            - RESOLVED
          description: "Current status"
        probability:
          type: string
          enum:
            - VERY_LIKELY
            - LIKELY
            - UNLIKELY
            - VERY_UNLIKELY
            - NONE
          description: "Likelihood of the issue occurring or impacting the project"
        severity:
          type: string
          enum:
            - CRITICAL
            - MAJOR
            - MINOR
            - MODERATE
            - NEGLIGIBLE
          description: "Impact level if the issue occurs"
        riskLevel:
          type: string
          enum:
            - CRITICAL
            - HIGH
            - MEDIUM
            - LOW
          description: "Overall risk assessment combining probability and severity"
        stream:
          type: string
          description: "Project workstream or area this issue relates to"
        created:
          type: string
          format: date-time
          description: "When the issue was first identified and recorded"
        createdBy:
          type: string
          format: uuid
          description: "User ID of the user who identified and logged the issue. References the User entity."
        updated:
          type: string
          format: date-time
          description: "When the issue was last updated"
        updatedBy:
          type: string
          format: uuid
          description: "User ID of the user who last updated the issue. References the User entity."
        notes:
          type: string
          description: "Detailed description of the issue and its context"
        correctiveAction:
          type: string
          description: "Planned or implemented actions to address the issue"
    AuditLogEntries:
      type: object
      properties:
        auditLogEntries:
          type: array
          items:
            $ref: "#/components/schemas/AuditLogEntry"
        paging:
          $ref: "#/components/schemas/Paging"
    AuditLogEntry:
      type: object
      properties:
        entryId:
          type: string
          format: uuid
        processId:
          type: string
          format: uuid
          description: ID for the Process that the audit log entry belongs to
        projectId:
          type: string
          format: uuid
          nullable: true
          description: ID for the Project related to the audit log entry
        taskId:
          type: string
          format: uuid
          nullable: true
          description: ID for the Task related to the audit log entry
        actorId:
          type: string
          description: "User ID of the user who performed the action. References the User entity."
        issueId:
          type: string
          format: uuid
          nullable: true
          description: ID for the Issue related to the audit log entry
        coverpagefieldId:
          type: string
          format: uuid
          nullable: true
          description: ID for the Coverpage field related to the audit log entry
        entityType:
          $ref: "#/components/schemas/AuditLogEntityType"
          description: Type of entity that was affected
        actionType:
          $ref: "#/components/schemas/AuditLogActionType"
          description: Type of action that was performed
        timestamp:
          type: string
          format: date-time
          description: When the action was performed
        aiGenerated:
          type: boolean
          nullable: true
          description: Whether the action was generated by AI
        description:
          type: string
          nullable: true
          description: Human-readable description of the action
        details:
          type: object
          nullable: true
          description: Additional details about the action in JSON format
    AuditLogEntityType:
      type: string
      enum:
        - PROJECT
        - TASK
        - DOCUMENT
        - ISSUE
        - PROCESS
        - TOUCH_POINT
      description: Type of entity that was affected in the audit log entry
    AuditLogActionType:
      type: string
      enum:
        - UNKNOWN
        - ACTIVITY_CREATED
        - ACTIVITY_COMMENT_CREATED
        - ACTIVITY_COMMENT_UPDATED
        - ACTIVITY_COMMENT_DELETED
        - ACTIVITY_UPDATED
        - ACTIVITY_DELETED
        - ACTIVITIES_EXPORTED
        - CONTACTS_EXPORTED
        - TASK_CREATED
        - TASK_DELETED
        - TASK_DEPENDENCY_ADDED
        - TASK_DEPENDENCY_REMOVED
        - TASK_DOCUMENT_CREATED
        - TASK_DOCUMENT_DELETED
        - TASK_DOCUMENT_DOWNLOADED
        - TASK_DOCUMENT_MOVED
        - TASK_DOCUMENT_PREVIEWED
        - TASK_DOCUMENT_UPDATED
        - TASK_DOCUMENTS_EXPORTED
        - TASK_EDITED
        - TASK_RESPONSIBLES_CHANGED
        - TASK_RESPONSIBLE_ADDED
        - TASK_RESPONSIBLE_REMOVED
        - TASK_RESPONSIBLE_ADDED_V2
        - TASK_RESPONSIBLE_REMOVED_V2
        - TASK_RESTORED
        - TASK_SOFT_DELETED
        - PROJECT_CREATED
        - PROJECT_DELETED
        - PROJECT_UPDATED
        - PROJECT_DEAL_SCORE_UPDATED
        - PROJECT_RENAMED
        - PROJECT_ARCHIVED
        - PROJECT_UNARCHIVED
        - PROJECT_LINKED
        - PROJECT_UNLINKED
        - PROJECT_MOVED_TO_STAGE
        - PROJECT_MOVED_TO_PROCESS
        - PROJECT_MOVED_FROM_PROCESS
        - PROCESS_COVERPAGE_FIELD_CREATED
        - PROCESS_COVERPAGE_FIELD_DELETED
        - PROCESS_COVERPAGE_FIELD_MODIFIED
        - PROCESS_COVERPAGE_GROUP_CREATED
        - PROCESS_COVERPAGE_GROUP_DELETED
        - PROCESS_COVERPAGE_GROUP_MODIFIED
        - PROCESS_GRID_EXPORTED
        - PROCESS_CREATED
        - PROCESS_UPDATED
        - PROCESS_DELETED
        - ISSUE_CREATED
        - ISSUE_UPDATED
        - ISSUE_DELETED
        - ISSUE_RESPONSIBLE_ADDED
        - ISSUE_RESPONSIBLE_REMOVED
        - ISSUE_TASK_LINKED
        - ISSUE_TASK_UNLINKED
        - ISSUE_TASKS_UNLINKED
        - ISSUES_CREATED
        - INTEGRATION_ENABLED
        - INTEGRATION_DISABLED
        - DOCUMENT_CREATED
        - DOCUMENT_UPDATED
        - DOCUMENT_DELETED
        - DOCUMENT_DOWNLOADED
        - DOCUMENT_PREVIEWED
        - DOCUMENTS_EXPORTED
      description: Type of action that was performed in the audit log entry
    User:
      type: object
      properties:
        userId:
          type: string
          description: "ID of the user"
        firstName:
          type: string
          description: "First name of the user"
        lastName:
          type: string
          description: "Last name of the user"
        fullName:
          type: string
          description: "Full name of the user"
        email:
          type: string
          format: email
          description: "Email of the user"
        role:
          $ref: "#/components/schemas/UserRole"
          description: "Role assigned to the user in the workspace"
        createdAt:
          type: string
          format: date-time
          description: "Date and time when the user was created"
        updatedAt:
          type: string
          format: date-time
          description: "Date and time when the user was last updated"
        lastAccess:
          type: string
          format: date-time
          description: "Date and time when the user last accessed the workspace"
        disabledAt:
          type: string
          format: date-time
          description: "Date and time when the user was disabled"
        isProtected:
          type: boolean
          description: "Whether the user is protected from deletion"
        company:
          type: string
          description: "Company name for the user"
        title:
          type: string
          description: "Job title for the user"
        phone:
          type: string
          description: "Phone number of the user"
    UserRole:
      type: string
      enum:
        - ADMIN
        - POWER_USER
        - ASSOCIATE
        - MEMBER
        - VDR_MEMBER
      description: "Role assigned to the user in the workspace, see more details from https://support.midaxo.com/s/article/Summary-of-Workspace-Roles-and-Group-Permissions"
  parameters:
    processIdParam:
      in: "path"
      name: processId
      description: "Id on process to fetch entities for"
      required: true
      schema:
        type: string
    initiativeIdParam:
      in: "path"
      name: initiativeId
      description: "Id on Initiative to fetch entities for"
      required: true
      schema:
        type: string
    taskIdParam:
      in: "path"
      name: taskId
      description: "Id on task to fetch entities for associated initiatives"
      required: true
      schema:
        type: string
    projectIdParam:
      in: "path"
      name: projectId
      description: "Id on project to fetch entities for"
      required: true
      schema:
        type: string
    userIdParam:
      in: "path"
      name: userId
      description: "Id of user to fetch"
      required: true
      schema:
        type: string
        format: uuid
