Certifyos Flag Calculator API

APIs for calculating and managing flags for monitoring workflows

OpenAPI Specification

certifyos-flagcalculator-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: API for Certify application
  title: Certify API Layer Flag Calculator API
  version: 1.0.0
servers:
- url: http://localhost:9000
  description: Local Development Server
- url: https://api-service.staging.certifyos.com
  description: Staging Server
- url: https://api-service.internal.certifyos.com
  description: Internal Server
- url: https://api-service.test.certifyos.com
  description: Test Server
- url: https://api-service.demo.certifyos.com
  description: Demo Server
- url: https://api-service.certifyos.com
  description: Production Server
tags:
- name: FlagCalculator
  description: APIs for calculating and managing flags for monitoring workflows
paths:
  /flag-calculator:
    post:
      summary: Calculate flags for a monitoring workflow
      description: Calculates flags for a monitoring workflow based on practitioner data and manages flag lifecycle (create/update/deactivate) according to the comparison with existing flags
      operationId: calculateFlags
      tags:
      - FlagCalculator
      parameters:
      - description: Tenant ID
        in: header
        required: true
        name: tenant-id
        schema:
          type: string
      - description: User ID for service-to-service calls
        required: false
        name: user-id
        in: header
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FlagCalculatorRequest'
        required: true
      responses:
        '200':
          description: Successfully calculated flags
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlagCalculatorResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Unauthorized - Authentication required
        '403':
          description: Forbidden - User does not have required permissions
        '404':
          description: Monitoring workflow not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '500':
          description: Internal Server Error - An unexpected error occurred
      security:
      - jwt: []
components:
  schemas:
    ApiError:
      description: Standard API error response containing a list of error objects
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorObject'
          description: List of error objects describing validation or processing failures
    FlagCalculatorResponse:
      description: Response from flag calculator operation
      type: object
      properties:
        flagsCreated:
          type: integer
          format: int32
          description: Number of flags created
          examples:
          - 5
        flagsUpdated:
          type: integer
          format: int32
          description: Number of flags updated
          examples:
          - 3
        flagsDeactivated:
          type: integer
          format: int32
          description: Number of flags deactivated
          examples:
          - 2
        totalFlags:
          type: integer
          format: int32
          description: Total number of flags after calculation
          examples:
          - 8
        monitoringWorkflowId:
          type: string
          description: ID of the monitoring workflow
          examples:
          - mw_1234567890
    ErrorObject:
      type: object
      description: Individual error object containing details about a specific validation or processing error
      properties:
        httpStatus:
          type: integer
          format: int32
          description: HTTP status code for this error
          examples:
          - 400
        reason:
          type: string
          description: Error reason/code
          examples:
          - VALIDATION_ERROR
        title:
          type: string
          description: Error title/summary
          examples:
          - 'Validation failed for field: eventTypes'
        detail:
          type: string
          description: Detailed error message
          examples:
          - eventTypes is required and cannot be empty or null
    FlagCalculatorRequest:
      description: Request to calculate flags for a monitoring workflow
      type: object
      required:
      - monitoringWorkflowId
      properties:
        monitoringWorkflowId:
          type: string
          description: ID of the monitoring workflow to calculate flags for
          examples:
          - mw_1234567890
          pattern: \S
        sections:
          type: array
          items:
            type: string
          description: Array of sections to calculate flags for. If not provided or empty, all sections' flags are calculated
          examples:
          - - licenses
            - education
  securitySchemes:
    jwt:
      type: http
      description: JWT Authentication - Provide only the raw token without Bearer prefix
      scheme: bearer
      bearerFormat: JWT