{
  "openapi": "3.0.3",
  "info": {
    "title": "myosh Viking REST API",
    "description": "The REST APIs enable you to access or update Viking data from your own applications in real time, using JSON request and response bodies.",
    "version": "3.0.3",
    "termsOfService": "https://myosh.com/terms-and-conditions/",
    "contact": {
      "email": "info@myosh.com"
    },
    "license": {
      "name": "Netsight licensed",
      "url": "https://myosh.com/implementation/"
    }
  },
  "servers": [
    {
      "url": "https://testapi.myosh.com/v3/{db}/",
      "description": "TEST",
      "variables": {
        "db": {
          "default": "demo1",
          "description": "customer schema name"
        }
      }
    },
    {
      "url": "https://oteapi.myosh.com/v3/{db}/",
      "description": "OTE",
      "variables": {
        "db": {
          "default": "demo1",
          "description": "customer schema name"
        }
      }
    },
    {
      "url": "https://api.myosh.com/v3/{db}/",
      "description": "PROD",
      "variables": {
        "db": {
          "default": "demo1",
          "description": "customer schema name"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "records",
      "description": "Operations for records"
    },
    {
      "name": "users",
      "description": "Operations for users"
    },
    {
      "name": "admin",
      "description": "Access to data found under the Administration area",
      "externalDocs": {
        "description": "Find out more",
        "url": "https://academy.myosh.com"
      }
    },
    {
      "name": "mobile",
      "description": "Special methods reserved for mobile use"
    },
    {
      "name": "result",
      "description": "Utility for checking processing status of POST requests"
    }
  ],
  "paths": {
    "/competencies": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "For Training Management, return a list of competencies.",
        "description": "Returns an array of all competencies",
        "operationId": "getCompetencies",
        "parameters": [],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Competency"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        },
        "security": [
          {
            "basicAuth": []
          }
        ]
      }
    },
    "/hierarchy": {
      "get": {
        "summary": "Return a list of hierarchy types and values.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "filter",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "type:in:[\"h2\", \"h1\"] or type:not_in:[\"h2\", \"h1\"].",
            "example": "type:in:[\"h2\", \"h1\"]"
          }
        ],
        "responses": {
          "200": {
            "description": "a JSON object of hierarchy type objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HierarchyResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/hierarchy/values": {
      "post": {
        "summary": "Create a new or update an existing value when id is provided.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "flag",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Hierarchy type id for new hierarchy value.",
            "example": "parent:Branch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HierarchyValue"
              }
            },
            "text/plain": {
              "schema": {
                "type": "object",
                "properties": {
                  "flag": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "example": "parent:Company",
                      "description": "parent hierarchy type id for new hierarchy value"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Command has been queued and will be processed later.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "the URL to query the processing status of this POST request"
              }
            }
          },
          "400": {
            "description": "The hierarchy value in POST request body is invalid."
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/geocode/reverse": {
      "get": {
        "summary": "Address reverse lookup by coordinates",
        "tags": [
          "mobile"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            },
            "description": "latitude",
            "example": "-31.037920"
          },
          {
            "name": "lon",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            },
            "description": "longitude",
            "example": "76.851641"
          }
        ],
        "responses": {
          "200": {
            "description": "Reverse look completed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apiVersion": {
                      "type": "string",
                      "example": "3.0"
                    },
                    "address": {
                      "type": "string",
                      "description": "address found at the specified coordinates; '[no result]' if no address is found",
                      "example": "Indian Ocean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/hierarchy/values/{hierarchyValueId}": {
      "get": {
        "summary": "Get a hierarchy value by id.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "hierarchyValueId",
            "in": "path",
            "required": true,
            "description": "The id of the hierarchy value to check",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HierarchyValue"
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "404": {
            "description": "the hierarchy value specified by id does not exist"
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/important": {
      "get": {
        "summary": "Return a list of \"important\" records, which are those displayed under My Activities in the web app.",
        "tags": [
          "records"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "filter",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "filter records. format is 'FIELD>value'. Multiple filters can be specified in a single request. Do not support format 'FIELD:value'",
            "example": "lastModified>2018-12-10T11:50:48.994Z"
          },
          {
            "in": "query",
            "name": "mobileOnly",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "return all important records enabled for mobile app only"
          }
        ],
        "responses": {
          "200": {
            "description": "a JSON array of important records for the current user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Record"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/locales": {
      "get": {
        "summary": "Return a list of locales.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "a JSON array of Locale objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Locale"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/modules": {
      "get": {
        "summary": "Return a list of modules accessible by the current user. Only modules visible to the user will be returned.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "mobileOnly",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "If true, only return module & forms enabled for mobile app."
          },
          {
            "in": "query",
            "name": "withFormsData",
            "schema": {
              "type": "boolean",
              "default": true
            },
            "required": false,
            "description": "If true, it will return forms under the corresponding module."
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON array of module objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Module"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/modules/simple": {
      "get": {
        "summary": "Return a list of simple version of modules accessible by the current user. Only modules visible to the user will be returned.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "mobileOnly",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "If true, only return module & forms enabled for mobile app."
          },
          {
            "in": "query",
            "name": "withFormsData",
            "schema": {
              "type": "boolean",
              "default": true
            },
            "required": false,
            "description": "If true, it will return forms under the corresponding module with a simple json structure."
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON array of simple module objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Module"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/modules/{moduleId}": {
      "get": {
        "summary": "Return a module by ID.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "moduleId",
            "in": "path",
            "required": true,
            "description": "The id of the module to check.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Module"
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "404": {
            "description": "The module specified by id does not exist."
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/forms": {
      "get": {
        "summary": "Return a list of  forms accessible by the current user.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "mobileOnly",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "If true, only return forms enabled for mobile app."
          },
          {
            "in": "query",
            "name": "moduleId",
            "schema": {
              "type": "string",
              "default": ""
            },
            "required": false,
            "description": "Return forms in the specified module."
          },
          {
            "in": "query",
            "name": "visitorForm",
            "schema": {
              "type": "boolean",
              "default": "false"
            },
            "required": false,
            "description": "If true, returns the first visitor form found."
          },
          {
            "in": "query",
            "name": "signInType",
            "schema": {
              "type": "string",
              "default": "VISITOR"
            },
            "required": false,
            "description": "Specifies the type of the requested form. Possible values are: VISITOR, EMPLOYEE. This only applies to forms with visitorForm=true."
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON array of module objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Form"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/forms/{formId}": {
      "get": {
        "summary": "Return a form by ID.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "formId",
            "in": "path",
            "required": true,
            "description": "The id of the form to check.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Form"
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "404": {
            "description": "The id specified does not exist."
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/occupations": {
      "get": {
        "summary": "Retun a list of occupations.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON array of occupation objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Occupation"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid"
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/occupationrequirements": {
      "get": {
        "summary": "Retun a list of occupational requirements.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "rowStart",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "required": false,
            "description": "Start index of records, default to 0.",
            "example": 0
          },
          {
            "in": "query",
            "name": "rowLimit",
            "schema": {
              "type": "integer",
              "default": -1
            },
            "required": false,
            "description": "Max number of records returned, default is -1/unlimited.",
            "example": 10
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON array of occupational requirement objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OccupationRequirement"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid"
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/records": {
      "get": {
        "summary": "Return a list of records.",
        "description": "Each result returned represents a single record. If you are fetching many records, it will be necessary to do so in batches. You may specify batch using the rowStart and rowLimit parameters, or filtering by lastModified > {date} and using rowLimit parameter. If you are working with a very large data set also make use of the returnColumns parameter to limit the amount of fields in the returned JSON. By default, archived records are generally excluded, although archived records with hasNormalReverseRecord=true may still be returned unless controlled via the filter parameter (for example, using filter=archivedStep:true). See the filter parameter description below for full details of archived-record behaviour.",
        "tags": [
          "records"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string",
              "default": "_id"
            },
            "required": false,
            "description": "Sort the result by the specified property (default is '_id').",
            "example": "creationDate"
          },
          {
            "in": "query",
            "name": "asc",
            "schema": {
              "type": "boolean",
              "default": true
            },
            "required": false,
            "description": "Sort the result in asc (default) or desc order.",
            "example": "false"
          },
          {
            "in": "query",
            "name": "returnColumns",
            "schema": {
              "type": "string",
              "default": ""
            },
            "required": false,
            "description": "Column names that need be included in the result. If there are multiple columns need be returned, separete them by ',' (comma). Default is to return all the columns.",
            "example": "fieldsToValues.Author,formName"
          },
          {
            "in": "query",
            "name": "rowStart",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "required": false,
            "description": "Start index of records, default to 0.",
            "example": 0
          },
          {
            "in": "query",
            "name": "rowLimit",
            "schema": {
              "type": "integer",
              "default": -1
            },
            "required": false,
            "description": "Max number of records returned, default is -1/unlimited.",
            "example": 10
          },
          {
            "in": "query",
            "name": "mobileOnly",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "If true, only return records only enabled for mobile app.",
            "example": false
          },
          {
            "in": "query",
            "name": "includeDraft",
            "schema": {
              "type": "boolean",
              "default": true
            },
            "required": false,
            "description": "If true, response returns draft records.",
            "example": true
          },
          {
            "in": "query",
            "name": "useSimpleStructure",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "If true, response returns simplified record documents from JDBC output.",
            "example": false
          },
          {
            "in": "query",
            "name": "filter",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "required": false,
            "description": "Apply filters using FIELD:VALUE, FIELD>VALUE, FIELD<VALUE, FIELD>=VALUE, or FIELD<=VALUE. Repeat the filter parameter to provide multiple conditions. Use filter=archivedStep:true to include archived records. Without archivedStep:true, archived records are excluded by default (except archived records that have hasNormalReverseRecord=true).",
            "example": "form:16"
          }
        ],
        "responses": {
          "200": {
            "description": "a JSON array of Record type objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Record"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      },
      "post": {
        "summary": "Create a new record, or update existing when id is matched.",
        "description": "Only one record represented as one JSON object can be submitted at a time.  Batch updates are not supported.\n\n\n\nIf updating, the body must include 'id' where this is the database unique key. The body must also include 'sourceID' where this is your own UUID.  You can use this ID in later operations for linking attached files, images and other records.  Other mandatory properties in the body are 'module' and 'form'.\n\n\n\nFields marked as mandatory in the form design must have a value set.  However if updating an existing record, it is only necessary to include fields whose values are changing. Please be aware, this doesn't apply to the linked attachments (files and images in fieldsToValues). If no attachment ids are provided, it means removing attachments if there's any.  \n\n\n\nAll date values must be formatted to ISO 8601 standard.\n\n\n\nEach record has an audit log which is updated with details of all operations including author, time/date, and field value changes.  The API will update the audit log when any record is created or updated.  Any email notifications triggered when the record is updated by API due to workflow status change or other condition will also be added to the audit log.\n\n",
        "tags": [
          "records"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Record"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "flag",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "default": "",
                "example": "holdNotification:true"
              }
            },
            "required": false,
            "description": "Special flag holdNotification prevents the notifications from being sent. These notifications cannot be sent later. The example of this parameter would be like: flag=holdNotification:true."
          },
          {
            "in": "query",
            "name": "validation",
            "schema": {
              "type": "string",
              "default": ""
            },
            "required": false,
            "description": "* DEFAULT (no validation parameters' given) - Import records with unrecognised options and leave the field blank/null where the unrecognised option is used.\n\n* validation=strict - Validate to ensure submitted options exist. Do not import the record if the option does not exist. Instead, return a validation failure message (No form found for record id: xxx) and Include details of the field and value that is not recognised.\n\n* validation=createAndArchive - Auto create unrecognised options and automatically mark them as archived after they are created. If more records are uploaded with the same option, it is now recognised and reused, even though it is an archived option.\n\n* validation=create - Auto create unrecognised options for all field types. Leave it to the end user to manually archive the relevant ones.\n\n* Some field types allow end users to add new values. For these fields, unrecognised options will automatically be added regardless of validation type.\n\n",
            "example": ""
          }
        ],
        "responses": {
          "202": {
            "description": "Validated successfully and accepted for processing",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "The URL to query the processing status of this POST request"
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      },
      "patch": {
        "summary": "Update existing when id is matched.",
        "description": "This endpoint is to update an existing record with the fields provided. Please note, fields will remain unchanged if no value is provided, including files and images. Please refer to POST /records for other description",
        "tags": [
          "records"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Record"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "flag",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "default": "",
                "example": "holdNotification:true"
              }
            },
            "required": false,
            "description": "Special flag holdNotification prevents the notifications from being sent. These notifications cannot be sent later. The example of this parameter would be like: flag=holdNotification:true."
          },
          {
            "in": "query",
            "name": "validation",
            "schema": {
              "type": "string",
              "default": ""
            },
            "required": false,
            "description": "* DEFAULT (no validation parameters' given) - Import records with unrecognised options and leave the field blank/null where the unrecognised option is used.\n\n* validation=strict - Validate to ensure submitted options exist. Do not import the record if the option does not exist. Instead, return a validation failure message (No form found for record id: xxx) and Include details of the field and value that is not recognised.\n\n* validation=createAndArchive - Auto create unrecognised options and automatically mark them as archived after they are created. If more records are uploaded with the same option, it is now recognised and reused, even though it is an archived option.\n\n* validation=create - Auto create unrecognised options for all field types. Leave it to the end user to manually archive the relevant ones.\n\n* Some field types allow end users to add new values. For these fields, unrecognised options will automatically be added regardless of validation type.\n\n",
            "example": ""
          }
        ],
        "responses": {
          "202": {
            "description": "Validated successfully and accepted for processing",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "The URL to query the processing status of this POST request"
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/records/{recordId}": {
      "get": {
        "summary": "Find and return a single record by ID.",
        "tags": [
          "records"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "description": "The id of the record to check",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Record"
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "404": {
            "description": "The id specified does not exist."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      },
      "delete": {
        "summary": "remove a record by sourceId.",
        "tags": [
          "records"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "recordId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "record's sourceId generated on mobile.",
            "required": true,
            "example": "123456"
          }
        ],
        "responses": {
          "202": {
            "description": "The request has been accepted",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "The URL to query the processing status of this DELETE request"
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/records/total": {
      "get": {
        "summary": "Return a total count of records.",
        "description": "Returns total counts for matching records. By default archived records are excluded from normal hits, except archived records that have hasNormalReverseRecord=true. Add filter=archivedStep:true to include all archived records in normal hits.",
        "tags": [
          "records"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "mobileOnly",
            "in": "query",
            "required": false,
            "description": "Return mobile only records count or all.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "in": "query",
            "name": "filter",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "required": false,
            "description": "Apply filters using FIELD:VALUE, FIELD>VALUE, FIELD<VALUE, FIELD>=VALUE, or FIELD<=VALUE. Repeat the filter parameter to provide multiple conditions. Use filter=archivedStep:true to include archived records. Without archivedStep:true, archived records are excluded by default (except archived records that have hasNormalReverseRecord=true).",
            "example": "form:16"
          },
          {
            "in": "query",
            "name": "includeDraft",
            "schema": {
              "type": "boolean",
              "default": true
            },
            "required": false,
            "description": "If true, response returns includes count of draft records.",
            "example": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apiVersion": {
                      "type": "string",
                      "example": "3.0"
                    },
                    "hits": {
                      "type": "number",
                      "format": "int64"
                    },
                    "hitsdeleted": {
                      "type": "number",
                      "format": "int64"
                    },
                    "hitsdraft": {
                      "type": "number",
                      "format": "int64"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        },
        "deprecated": true
      }
    },
    "/records/totals": {
      "get": {
        "summary": "Return the total record counts for each form. Used to determine how many batches are needed.",
        "description": "Returns per-form counts for matching records. By default archived records are excluded from normal hits, except archived records that have hasNormalReverseRecord=true. Add filter=archivedStep:true to include archived records in normal hits.",
        "tags": [
          "records"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "mobileOnly",
            "in": "query",
            "required": false,
            "description": "Return mobile only records count or all.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "in": "query",
            "name": "filter",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "required": false,
            "description": "Apply filters using FIELD:VALUE, FIELD>VALUE, FIELD<VALUE, FIELD>=VALUE, or FIELD<=VALUE. Use filter=archivedStep:true to include archived records. Without archivedStep:true, archived records are excluded by default (except archived records that have hasNormalReverseRecord=true).",
            "example": "form:16"
          },
          {
            "name": "includeDraft",
            "in": "query",
            "required": false,
            "description": "If true, response returns includes count of draft records.",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "useFormDateRange",
            "in": "query",
            "required": false,
            "description": "If true, response returns records in the date range of form",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "apiVersion": {
                        "type": "string",
                        "example": "3.0"
                      },
                      "formName": {
                        "type": "object",
                        "properties": {
                          "hits": {
                            "type": "number",
                            "format": "int64"
                          },
                          "hitsDeleted": {
                            "type": "number",
                            "format": "int64"
                          },
                          "hitsDraft": {
                            "type": "number",
                            "format": "int64"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/records/recurrence": {
      "post": {
        "summary": "Add a recurrence rule to a record.",
        "tags": [
          "records"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "validation",
            "schema": {
              "type": "string",
              "default": "default"
            },
            "required": false,
            "description": "* DEFAULT (no validation parameters' given) - Import records with unrecognised options and leave the field blank/null where the unrecognised option is used.\n\n* validation=strict - Validate to ensure submitted options exist. Do not import the record if the option does not exist. Instead, return a validation failure message (No form found for record id: xxx) and Include details of the field and value that is not recognised.\n\n* validation=createAndArchive - Auto create unrecognised options and automatically mark them as archived after they are created. If more records are uploaded with the same option, it is now recognised and reused, even though it is an archived option.\n\n* validation=create - Auto create unrecognised options for all field types. Leave it to the end user to manually archive the relevant ones.\n\n",
            "example": "default"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Record"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Created",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "The URL to query the processing status of this POST request"
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/riskmatrix": {
      "get": {
        "summary": "Return a list of RiskRating types and values.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "a JSON array of RiskRating type objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/RiskRating"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/roles": {
      "get": {
        "summary": "Return a list of Role types and values.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "a JSON array of Role type objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Role"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/sites": {
      "get": {
        "summary": "Return a list of Site types and valid values",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "a JSON array of Site type objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Site"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/users": {
      "get": {
        "summary": "Return a list of users.",
        "tags": [
          "users"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string",
              "default": "fullName"
            },
            "required": false,
            "description": "Sort the result by the specified property (default is 'fullName').",
            "example": "fullName"
          },
          {
            "in": "query",
            "name": "asc",
            "schema": {
              "type": "boolean",
              "default": true
            },
            "required": false,
            "description": "Sort the result in asc (default) or desc order.",
            "example": "false"
          },
          {
            "in": "query",
            "name": "returnColumns",
            "schema": {
              "type": "string",
              "default": ""
            },
            "required": false,
            "description": "It is used for specifying column names included in the result. If there are multiple columns need be returned, separete them by ',' (comma). Default is to return all the columns",
            "example": "fieldsToValues.First Name,fieldsToValues.Last Name"
          },
          {
            "in": "query",
            "name": "rowStart",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "required": false,
            "description": "Start index of users, default to 0.",
            "example": 0
          },
          {
            "in": "query",
            "name": "rowLimit",
            "schema": {
              "type": "integer",
              "default": -1
            },
            "required": false,
            "description": "Max number of users returned, default is -1/unlimited.",
            "example": 10
          },
          {
            "in": "query",
            "name": "ignoreHierarchyAccess",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "If true, do not restrict results by the logged-in user's hierarchy access.",
            "example": false
          },
          {
            "in": "query",
            "name": "filter",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Filter format is 'FIELD:value'. Multiple filters can be specified in a single request. Boolean values are supported, for example filter=fieldsToValues.ssoUser:true to return SSO users only.",
            "example": "fieldsToValues.ssoUser:true"
          }
        ],
        "responses": {
          "200": {
            "description": "a JSON array of user type objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/User"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      },
      "post": {
        "summary": "Create a new user or update an existing one.",
        "description": "All modifications must be performed using a user ID that has access to perform the operations.\n\n\n\nOnly one user represented as one JSON object can be submitted at a time.  Batch updates are not supported.\n\n\n\nIf updating, the body must include 'unid' where this is the database unique key. \n\n\n\nYou can create users with or without logins by setting the \"loginRequired\" property to true or false.  If true, the user can login and a license will be allocated to them.  The username, email and roles properties are mandatory if \"loginRequired\" is true.  First Name, Last Name and userHierarchies are always required.\n\n\n\nEach user record has an audit log which is updated with details of all operations including author, time/date, and field value changes.  The API will update the audit log when any record is created or updated. \n\n Please note, user archiving will need to provide either 'id' or 'username' in request body. ",
        "tags": [
          "users"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "lookupHierarchy",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "Support lookup of hierarchy values.",
            "example": false
          },
          {
            "in": "query",
            "name": "flag",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "default": "",
                "example": "holdEmail:true"
              }
            },
            "required": false,
            "description": "Special flag holdEmail prevents the account registration email from being sent.  These emails are stored in the Administration area and can be released later if required. The example of this parameter would be like: flag=holdEmail:true. "
          },
          {
            "in": "query",
            "name": "validation",
            "schema": {
              "type": "string",
              "default": "default"
            },
            "required": false,
            "description": "* DEFAULT (no validation parameters' given) - Import users with unrecognised hierarchy values and leave the field blank/null where the unrecognised hierarchy value is used.\n\n* validation=strict - Validate to ensure submitted hierarchy values exist. Do not import the user if the hierarchy value does not exist. Instead, return a validation failure message and Include details of the field and value that is not recognised.\n\n* validation=createAndArchive - Auto create unrecognised hierarchy values and automatically mark them as archived after they are created. If more users are uploaded with the same hierarchy value, it is now recognised and reused, even though it is an archived hierarchy value.\n\n* validation=create - Auto create unrecognised hierarchy values. Leave it to the end user to manually archive the relevant ones.\n\n",
            "example": ""
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/User"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Rerquest created.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "The URL to query the processing status of this POST request"
              }
            }
          },
          "400": {
            "description": "The hierarchy value in POST request body is invalid"
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/users/total": {
      "get": {
        "summary": "Return a total count of users.",
        "tags": [
          "users"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "ignoreHierarchyAccess",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "If true, do not restrict results by the logged-in user's hierarchy access.",
            "example": false
          },
          {
            "in": "query",
            "name": "filter",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Filter format is 'FIELD:value'. Multiple filters can be specified in a single request. Boolean values are supported, for example filter=fieldsToValues.ssoUser:true to count SSO users only.",
            "example": "fieldsToValues.ssoUser:true"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apiVersion": {
                      "type": "string",
                      "example": "3.0"
                    },
                    "hits": {
                      "type": "number",
                      "format": "int64"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/users/location": {
      "post": {
        "summary": "Create a new location entry.",
        "description": "Used by mobile for tracking location.",
        "tags": [
          "users"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserLocation"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Created",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "The URL to query the processing status of this POST request"
              }
            }
          },
          "400": {
            "description": "The request body provided is invalid. The user id might not exist or the request body is missing a mandatory field."
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/users/{id}": {
      "get": {
        "summary": "Find and return a single user by unid.",
        "tags": [
          "users"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unid or _id of the user to find",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "404": {
            "description": "The user specified by id does not exist"
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/loggedinuser": {
      "get": {
        "summary": "Fetch details of the currently authenticated user",
        "tags": [
          "users"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/commands/{commandId}": {
      "get": {
        "summary": "Fetch the processing status of a previous request using the id provided. If it has been processed successfully, this results in a redirect to the newly created resource.",
        "deprecated": true,
        "tags": [
          "result"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "commandId",
            "in": "path",
            "required": true,
            "description": "The id of the command to check",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pending, the resource is not available yet",
            "headers": {
              "Status": {
                "schema": {
                  "type": "string",
                  "example": "Pending"
                },
                "description": "The status of the resource, usually Pending"
              }
            }
          },
          "303": {
            "description": "the resource is available",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "example": "/myoshREST/{db}/REST/3.0/[Records|Uers]/{resourceId}"
                },
                "description": "the url to access the Saved User or Record"
              }
            }
          },
          "400": {
            "description": "the request failed",
            "headers": {
              "Status": {
                "schema": {
                  "type": "string",
                  "example": "Failed"
                },
                "description": "The request failed. A common reason is data validation"
              },
              "Error": {
                "schema": {
                  "type": "string",
                  "example": "Failed to execute command {error message}"
                },
                "description": "Error details of the failed command"
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "404": {
            "description": "Invalid command id."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/result/{id}": {
      "get": {
        "summary": "Return the processing status of POST request.",
        "description": "All requests are processed asynchronously by our backend, event-driven message handler.  Use this API to check the processing status of a previous POST.  If processing was unsuccessful, the “errorMessage” property will describe the error that occurred.\n\n",
        "tags": [
          "result"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The command result id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "processed": {
                      "type": "boolean"
                    },
                    "resourceId": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "errorMessage": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization information is missing or invalid."
          },
          "404": {
            "description": "Invalid command id."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/notification": {
      "post": {
        "summary": "Send a push notification.  Only authorised users are permitted.",
        "tags": [
          "mobile"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushNotification"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The push notification is sent."
          },
          "400": {
            "description": "Failed to send the notification.",
            "headers": {
              "Error": {
                "schema": {
                  "type": "string",
                  "example": [
                    "No message found",
                    "No device found"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/device": {
      "post": {
        "summary": "Register a device.",
        "description": "Used to register a mobile device token against a user account for mobile app push notifications.  Multiple devices can be registered to a user account.",
        "tags": [
          "mobile"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "text/plain": {
              "schema": {
                "type": "object",
                "properties": {
                  "deviceToken": {
                    "type": "string",
                    "description": "Device's id"
                  },
                  "deviceType": {
                    "type": "string",
                    "example": "IOS",
                    "description": "type must be one of (IOS,WINDOW,ANDROID)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The request has been accepted"
          },
          "400": {
            "description": "Failed to send the request",
            "headers": {
              "Error": {
                "schema": {
                  "type": "string",
                  "example": [
                    "No message found",
                    "No device found"
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Unregister a device.",
        "tags": [
          "mobile"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "deviceToken",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Device's id",
            "required": true,
            "example": 123456
          },
          {
            "name": "deviceType",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Device's type(IOS,WINDOW,ANDROID)",
            "required": true,
            "example": "IOS"
          }
        ],
        "responses": {
          "202": {
            "description": "The request has been accepted"
          },
          "400": {
            "description": "Failed to process the request.",
            "headers": {
              "Error": {
                "schema": {
                  "type": "string",
                  "example": [
                    "No message found",
                    "No device found"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files": {
      "get": {
        "summary": "Return a list of all attachments",
        "tags": [
          "records"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "mobileOnly",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "return all attachments of records enabled for mobile app only"
          },
          {
            "in": "query",
            "name": "filter",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "example": "form=1"
              },
              "default": "[]"
            },
            "required": false,
            "description": "Filter the result using the specified criteria."
          },
          {
            "in": "query",
            "name": "rowStart",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "required": false,
            "description": "Start index of records, default to 0.",
            "example": 0
          },
          {
            "in": "query",
            "name": "rowLimit",
            "schema": {
              "type": "integer",
              "default": -1
            },
            "required": false,
            "description": "Max number of records returned, default is -1/unlimited.",
            "example": 10
          }
        ],
        "responses": {
          "200": {
            "description": "a JSON array of user type objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Attachment"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      },
      "post": {
        "summary": "Upload a file that can be attached to a record later.",
        "tags": [
          "records"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "sourceID",
            "description": "UUID of your choosing which you can reference when attaching this file to the correct record",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "recordSourceID",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "An id used for linking the file to a record."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "fileName": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The request has been accepted"
          },
          "401": {
            "description": "Unauthorized"
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    },
    "/files/{sourceID}": {
      "get": {
        "summary": "Return metadata of an attachment.",
        "description": "Return the metadata of an attachment including a download URL for fetching the binary file.",
        "tags": [
          "records"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "sourceID",
            "in": "path",
            "required": true,
            "description": "The sourceID of the attachment to check",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attachment"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "503": {
            "description": "Not supported by Domino."
          },
          "601": {
            "description": "Incorrect JSON is given in request."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    },
    "schemas": {
      "Competency": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "author": {
            "type": "string"
          },
          "trainingTime": {
            "type": "number"
          },
          "costs": {
            "type": "number"
          },
          "proficiency": {
            "type": "string"
          },
          "archived": {
            "type": "boolean"
          }
        }
      },
      "Record": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "If add a new record, set id null; if edit a existing record, set existing record's resource id.",
            "example": 248
          },
          "sourceID": {
            "type": "string",
            "description": "Available when posting a record. Generated by Mobile APP and posted as a child record linked to a parent record's recordlink field. In the parent record's request body, this sourceID is filled in  recordlink field. refer to fieldsToValues's example. If sourceID is null, the value equals id.",
            "example": 248
          },
          "complete": {
            "type": "boolean"
          },
          "creationDate": {
            "description": "the date when this record was created",
            "type": "string",
            "format": "DateTime",
            "example": "2018-05-07T03:11:03.197Z"
          },
          "fieldsToValues": {
            "description": "This map uses string as keys and values. This map contains the all fields and corresponding values in a record, except for a few special field types (RISKRATING,  TEXTUAL_QUESTIONNAIRE, NUMERIC_QUESTIONNAIRE). Please use the value in 'fieldsToAdditionalValues' map to retrive the RISKRATING id, and use 'fieldsToQuestionWithAnswers' to retrieve the answers for each  question in a TEXTUAL_QUESTIONNAIRE or NUMERIC_QUESTIONNAIRE field. The JSON format in the body of POST request of this API should be in the same format as returned by the GET request of this API files - define files attached to this record. Multiple files are joined with '~~ '.  File id is uuid generated on Mobile APP. images - define images attached to this record. Multiple files are joined with '~~ '. file id is uuid generated on Mobile APP.",
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "Form Name": "MyFirstForm",
              "Company": "myosh",
              "Author": "Trayson Cui",
              "Division": "AU",
              "riskfield": "2",
              "field1": "testRecordAPI",
              "status": "1",
              "n_q": "21",
              "t_q_total_available": "3.0",
              "t_q_percentage": "-100%",
              "t_q": "-3",
              "n_q_total_available": "28.0",
              "n_q_percentage": "75%",
              "grand score - Percentage": "64.52%",
              "grand score - Max Possible": "31.0",
              "grand score - Total Score": "20.0",
              "trainingfield": "1",
              "multile-value field": "Option 1~~ Option 2",
              "multile-person field": "Bournee Jase~~ Johnson John",
              "recordlinkfield": "254~~ UUID",
              "images": "uuid3~~ uuid4",
              "files": "uuid1~~ uuid2",
              "Record Link": "175~~ 129~~ 72"
            }
          },
          "fieldsToAdditionalValues": {
            "description": "Map<String, String>, This object contains all RISKRATING fields in the user form. The key is field name, the value is the id of the rating which can be found in the output of /riskmatrix api. This Map is also used in the POST request body of /records API to create/update values of RISKRATING fields. The JSON format in the body of POST  request of this API should be in the same format as returned by the  GET request of this API",
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "riskfield": 3
            }
          },
          "fieldsToQuestionWithAnswers": {
            "type": "object",
            "description": "Map<String, List<QuestionWithAnswer>> , this object contains more information for TEXTUAL_QUESTIONNAIRE and NUMERIC_QUESTIONNAIRE fields. It is map between field caption (id) and QuestionWithAnswer objects. The QuestionWithAnswer Object contains all the information for each question and its answer for the specified T_Q/N_Q field.  This map is also used in the request body of 'POST /records' API to  create/update values of TEXTUAL_QUESTIONNAIRE and NUMERIC_QUESTIONNAIRE fields. The JSON format in the body of POST request of this API  should be in the same format as returned by the GET request of this API",
            "additionalProperties": {
              "$ref": "#/components/schemas/QuestionWithAnswer"
            },
            "example": {
              "n_q": [
                {
                  "answerId": null,
                  "files": "uuid1~~ uuid2",
                  "images": "uuid3~~ uuid4",
                  "intValue": "1",
                  "linkedRecordIds": "291~~ 144~~ 290",
                  "observations": "observations",
                  "questionId": "7"
                },
                {
                  "answerId": null,
                  "files": "uuid1~~ uuid2",
                  "images": "uuid3~~ uuid4",
                  "intValue": "4",
                  "linkedRecordIds": "291~~ 144~~ 290",
                  "observations": "observations",
                  "questionId": "4"
                }
              ],
              "t_q": [
                {
                  "answerId": "7",
                  "files": "uuid1~~ uuid2",
                  "images": "uuid3~~ uuid4",
                  "intValue": null,
                  "linkedRecordIds": "291~~ 144~~ 290",
                  "observations": "observations",
                  "questionId": "5"
                },
                {
                  "answerId": "7",
                  "files": "uuid1~~ uuid2",
                  "images": "uuid3~~ uuid4",
                  "intValue": null,
                  "linkedRecordIds": "291~~ 144~~ 290",
                  "observations": "observations",
                  "questionId": "6"
                }
              ]
            }
          },
          "form": {
            "description": "The id of the target form.",
            "type": "string",
            "example": "10"
          },
          "formName": {
            "description": "Form name of this record.",
            "type": "string",
            "example": "Actions"
          },
          "important": {
            "description": "Define this record is important.",
            "type": "boolean"
          },
          "importantDocNo": {
            "type": "string",
            "example": null
          },
          "lastModified": {
            "description": "Define date when last modification was made.",
            "type": "string",
            "format": "DateTime",
            "example": "2018-05-09T00:33:36.987Z"
          },
          "linkUrl": {
            "description": "URL address of this record",
            "type": "string",
            "example": "https://LOCALHOST/MyoshWebBase/load/?f=modules/testmoduleimportviewid1/248"
          },
          "location": {
            "$ref": "#/components/schemas/Location"
          },
          "module": {
            "description": "The id of the target module.",
            "type": "string",
            "example": "5"
          },
          "moduleName": {
            "type": "string",
            "example": "Actions"
          },
          "persistedSinceLastEdit": {
            "description": "Determine if this record should be persisted to db.",
            "type": "boolean"
          },
          "readAccessRoles": {
            "description": "Role names allowed to read this record.",
            "type": "array",
            "items": {
              "type": "string",
              "example": "admin"
            }
          },
          "records": {
            "description": "Records linked to this record.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          },
          "invitations": {
            "description": "User id invited to handle this record together, not supported in POST API.",
            "type": "array",
            "items": {
              "type": "string",
              "example": null
            }
          },
          "deleted": {
            "description": "Determine if this record has been removed from Viking; not supported in POST API.",
            "type": "boolean"
          },
          "displayText": {
            "description": "A String representation of the values of the selected fields in the mobile app record list, The values should be separated by \" - \"",
            "type": "string",
            "example": "2018-10-09 - Filled vehicle with wrong fuel - Doyle Andrew"
          },
          "archivedStep": {
            "description": "True when the record is in an archived workflow step.",
            "type": "boolean"
          },
          "hasNormalReverseRecord": {
            "description": "True when there is an active reverse record that is still surfaced by default archived filtering.",
            "type": "boolean"
          },
          "scheduledRecord": {
            "$ref": "#/components/schemas/ScheduledRecord"
          }
        },
        "required": [
          "fieldsToValues",
          "fieldsToAdditionalValues",
          "form"
        ]
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "CN=Jase BOURNE/O=zzdm7",
            "description": "Same as username, mandatory if fieldsToValues.loginRequired is true"
          },
          "unid": {
            "type": "string",
            "example": 2,
            "description": "If add a new user, set id null; if edit a existing user, set existing user's resource id."
          },
          "fieldsToValues": {
            "description": "Map<String, String>.  if loginRequired is true, userid, email and roles are mandatory. Manager stored user id or email, occupation and secondaryOccupation store name.  Affiliation has four options - Employee,Contractor,Volunteer,Guest",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "firstName": "Angela",
              "lastName": "Adminson",
              "fullName": "Adminson Angela",
              "userName": "example@myosh.com",
              "email": "example@myosh.com",
              "site": "Mount Cloud",
              "employeeID": "5",
              "empNo": "1",
              "prefName": "Angela A",
              "lastModified": "2017-05-31T06:25:02.598Z",
              "startDate": "2017-05-31T06:25:02.598Z",
              "loginRequired": true,
              "ssoUser": "true",
              "manager": "manager@myosh.com",
              "occupation": "occupation name",
              "secondaryOccupation": "CFO~~ CEO",
              "affiliation": "Contractor"
            }
          },
          "hierarchyFieldAccess": {
            "description": "Hierarchies allowed to be accessed.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HierarchyField"
            }
          },
          "userHierarchies": {
            "description": "hierarchies of this user",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HierarchyField"
            }
          },
          "roles": {
            "description": "Role names this user belongs to, mandatory if fieldsToValues.loginRequired is true.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Role"
            }
          },
          "locale": {
            "$ref": "#/components/schemas/Locale"
          },
          "prefName": {
            "description": "lastName + firstName",
            "type": "string",
            "example": "Angela A"
          },
          "startDate": {
            "description": "The date when the user is created.",
            "type": "string",
            "format": "DateTime",
            "example": "2017-05-31T06:25:02.598Z"
          },
          "firstName": {
            "type": "string",
            "example": "Angela"
          },
          "lastName": {
            "type": "string",
            "example": "Adminson"
          },
          "fullName": {
            "description": "lastName + firstName",
            "type": "string",
            "example": "Adminson Angela"
          },
          "lastModified": {
            "description": "The date when the user is modified recently.",
            "type": "string",
            "format": "DateTime"
          },
          "email": {
            "description": "The user's email, mandatory if fieldsToValues.loginRequired is true",
            "type": "string",
            "format": "email"
          },
          "docNo": {
            "type": "integer",
            "format": "int64"
          },
          "preferredLanguage": {
            "description": "Preferred language of this user",
            "type": "string",
            "example": "en-AU"
          }
        },
        "required": [
          "firstName",
          "lastName",
          "locale",
          "userHierarchies",
          "email",
          "id",
          "roles"
        ],
        "example": {
          "id": "john.smith@myosh.com",
          "unid": "108",
          "fieldsToValues": {
            "Email": "john.smith@myosh.com",
            "occupation": "",
            "manager": "john.smith.manager@myosh.com",
            "First Name": "shuibing",
            "loginRequired": "true",
            "superUser": "false",
            "ldapSuperUser": "false",
            "archived": "false",
            "password": null,
            "Username": "john.smith@myosh.com",
            "Phone": null,
            "unidDominoKey": null,
            "secondaryOccupation": "CFO~~ CEO",
            "affiliation": "Contractor",
            "retypePassword": null,
            "Last Name": "cui",
            "employeeID": "5"
          },
          "userHierarchies": [
            {
              "hierarchyField": "Company",
              "value": "myosh"
            },
            {
              "hierarchyField": "Division",
              "value": "Transport"
            },
            {
              "hierarchyField": "Department",
              "value": "Production"
            },
            {
              "hierarchyField": "Site",
              "value": "Mount Bryant"
            }
          ],
          "hierarchyFieldAccess": [
            {
              "hierarchyField": "Company",
              "value": "myosh"
            },
            {
              "hierarchyField": "Division",
              "value": "Transport"
            }
          ],
          "locale": {
            "id": 1,
            "dateFormat": "dd/MM/yyyy",
            "languageTag": "en-AU"
          },
          "roles": [
            "Admin",
            "Full Admin Access",
            "User"
          ],
          "readAccessRoles": [],
          "preferredLanguage": "en-AU",
          "prefName": "John Smith",
          "startDate": null,
          "firstName": "John",
          "lastName": "Smith",
          "fullName": "John Smith",
          "lastModified": "2018-05-04T12:59:41.240Z",
          "email": "john.smith@myosh.com",
          "docNo": null
        }
      },
      "HierarchyResponse": {
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string",
            "example": "3.0"
          },
          "hits": {
            "type": "string",
            "example": "1"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Hierarchy"
            }
          }
        }
      },
      "Hierarchy": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "Company"
          },
          "weight": {
            "description": "Used for ordering the hierarchy levels when displayed in the form. Lowest weight is displayed first.",
            "type": "integer",
            "example": "1"
          },
          "name": {
            "type": "string",
            "example": "Company"
          },
          "valueEntities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HierarchyValue"
            },
            "description": "Detailed information of all hierarchy values"
          }
        }
      },
      "HierarchyField": {
        "type": "object",
        "properties": {
          "hierarchyField": {
            "description": "hierarchy field name",
            "type": "string",
            "example": "Company"
          },
          "value": {
            "description": "hierarchy field value",
            "type": "string",
            "example": "myosh"
          }
        }
      },
      "Locale": {
        "description": "Not mandatory but will be set to a default value (en_AU) if not supplied.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": 1
          },
          "dateFormat": {
            "type": "string",
            "example": "dd/MM/yyyy"
          },
          "languageTag": {
            "type": "string",
            "example": "en-AU"
          }
        }
      },
      "Module": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": 3
          },
          "moduleName": {
            "type": "string",
            "example": "Incident Reporting"
          },
          "viewId": {
            "type": "string",
            "example": null
          },
          "forms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Form"
            }
          },
          "icon": {
            "description": "define icon displayed on the left of module name on the sidemenu",
            "type": "string",
            "example": "WRENCH"
          }
        }
      },
      "Form": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": 23
          },
          "formName": {
            "type": "string",
            "example": "Major Investigation Process"
          },
          "moduleId": {
            "type": "string",
            "example": "9"
          },
          "moduleName": {
            "type": "string",
            "example": "Action"
          },
          "workflow": {
            "$ref": "#/components/schemas/Workflow"
          },
          "fieldgroups": {
            "description": "Field groups to be contained by this form, including two special fieldgroups named Hierarchy and Attachment. See the below example.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldGroup"
            },
            "example": [
              {
                "fieldGroupName": "Hierarchy",
                "parentkey": null,
                "fields": [
                  {
                    "fieldname": "Company",
                    "fieldlabel": "Company",
                    "fieldtype": "COMBOBOX",
                    "defaultvalue": "myosh",
                    "required": true,
                    "searchfull": false,
                    "source": {
                      "from": "OPTIONS",
                      "options": [
                        "ABCDE Inc.",
                        "Another Corp Inc.",
                        "DE_Edit Inc.",
                        "myosh",
                        "New Corp Inc."
                      ],
                      "colors": null
                    },
                    "validations": null,
                    "visibilityConditions": null,
                    "allowNewValue": false,
                    "summaryField": false,
                    "help": null,
                    "hint": null,
                    "hints": null,
                    "helps": null,
                    "position": 0,
                    "metadata": null
                  },
                  {
                    "fieldname": "Division",
                    "fieldlabel": "Division",
                    "fieldtype": "COMBOBOX",
                    "defaultvalue": "Transport",
                    "required": true,
                    "searchfull": false,
                    "source": {
                      "from": "OPTIONS",
                      "options": [
                        "Sales",
                        "Transport",
                        "Service",
                        "Production"
                      ],
                      "colors": null
                    },
                    "validations": null,
                    "visibilityConditions": null,
                    "allowNewValue": false,
                    "summaryField": false,
                    "help": null,
                    "hint": null,
                    "hints": null,
                    "helps": null,
                    "position": 1,
                    "metadata": null
                  }
                ],
                "visibilityConditions": null
              },
              {
                "fieldGroupName": "Associated Incidents",
                "parentkey\"": "",
                "fields": [
                  {
                    "fieldname": "Associated Incidents",
                    "fieldlabel": "Associated Incidents",
                    "fieldtype": "REVERSE_RECORD_LINK",
                    "required": false,
                    "targetFormId": 11,
                    "targetModuleId": 5,
                    "visibilityConditions": null,
                    "recordLinkFormat": "[Field|185|Brief Description][Field|164|Classification (Outcomes)][Field|229|Date Occurred][Keyword|3|WorkflowStep]",
                    "recordLinkType": "LINK",
                    "help": "help text",
                    "hint": "hint for text",
                    "hints": {
                      "es-AR": "",
                      "en-AU": "hint for text",
                      "zh-CN": "",
                      "ja-JP": ""
                    },
                    "helps": {
                      "es-AR": "",
                      "en-AU": "help text",
                      "zh-CN": "",
                      "ja-JP": ""
                    },
                    "prefillFieldOnNewRecord": false,
                    "recordLinkTargetPrefillValues": null,
                    "showSelectButton": false
                  }
                ],
                "visibilityConditions": null
              },
              {
                "fieldGroupName": "Attachment",
                "parentkey": null,
                "fields": [
                  {
                    "fieldname": null,
                    "fieldlabel": "images",
                    "fieldtype": "IMAGES",
                    "defaultvalue": null,
                    "required": false,
                    "source": null,
                    "validations": null,
                    "visibilityConditions": null,
                    "summaryField": false,
                    "help": null,
                    "hint": null,
                    "hints": null,
                    "helps": null,
                    "position": 0,
                    "metadata": null
                  },
                  {
                    "fieldname": null,
                    "fieldlabel": "files",
                    "fieldtype": "FILES",
                    "defaultvalue": null,
                    "required": false,
                    "source": null,
                    "validations": null,
                    "visibilityConditions": null,
                    "summaryField": false,
                    "help": null,
                    "hint": null,
                    "hints": null,
                    "helps": null,
                    "position": 1,
                    "metadata": null
                  }
                ],
                "visibilityConditions": null
              }
            ]
          },
          "displayfields": {
            "description": "field names allowed to be displayed",
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "Date"
            ]
          },
          "enabledForMobile": {
            "description": "this form can be used in mobile apps",
            "type": "boolean"
          },
          "createRecord": {
            "description": "allowed or not to create records of this form",
            "type": "boolean"
          },
          "readRecord": {
            "description": "allowed or not to read records of this form",
            "type": "boolean"
          },
          "editRecord": {
            "description": "allowed or not to edit records of this form",
            "type": "boolean"
          },
          "deleteRecord": {
            "description": "allowed or not to delete records of this form",
            "type": "boolean"
          },
          "hierarchyHiddenInReadMode": {
            "description": "hide hierarchy when in read mode",
            "type": "boolean"
          },
          "importantConditionsEnabled": {
            "description": "Enable notification badge alerts for this form",
            "type": "boolean"
          },
          "defaultForm": {
            "description": "define a default form for a module",
            "type": "boolean"
          },
          "visitorForm": {
            "description": "define a visitor form for a module",
            "type": "boolean"
          },
          "signInStep": {
            "description": "define sign-in workflow step",
            "type": "string",
            "example": "Sign In"
          },
          "signOutStep": {
            "description": "define sign-out workflow step",
            "type": "string",
            "example": "Sign Out"
          },
          "fullNameField": {
            "description": "define a textfield to be used for the visitor full name input",
            "type": "string",
            "example": "Full Name"
          },
          "signInType": {
            "description": "define the type of this sign in form",
            "type": "string",
            "example": "VISITOR"
          }
        }
      },
      "Workflow": {
        "type": "object",
        "properties": {
          "initialStep": {
            "description": "define start workflow step in this workflow",
            "type": "string",
            "example": "Open"
          },
          "workflowSteps": {
            "description": "define workflow steps enabled for this workflow",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowStep"
            }
          }
        }
      },
      "WorkflowStep": {
        "type": "object",
        "properties": {
          "statusLabel": {
            "type": "string"
          },
          "isDraft": {
            "type": "boolean",
            "example": false
          },
          "backgroundColor": {
            "type": "string",
            "description": "colour for the status label"
          },
          "nextSteps": {
            "description": "define possible next steps when advance a record from this step",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowNextStep"
            },
            "example": null
          },
          "fieldGroupsRead": {
            "description": "define field groups allowed to read.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "fieldGroupsEdit": {
            "description": "define field groups allowed to edit.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "statusLabel": "3",
          "isDraft": false,
          "backgroundColor": "#d27319",
          "nextSteps": [
            {
              "buttonLabel": null,
              "nextStep": "1",
              "closeOnSave": true,
              "promptBeforeAdvance": "true",
              "conditions": null
            }
          ],
          "fieldGroupsRead": [
            "section1"
          ],
          "fieldGroupsEdit": [
            "section1"
          ]
        }
      },
      "WorkflowNextStep": {
        "type": "object",
        "properties": {
          "buttonLabel": {
            "description": "button label for next step used when advance a record",
            "type": "string"
          },
          "nextStep": {
            "description": "name of next step",
            "type": "string"
          },
          "closeOnSave": {
            "description": "allowed to close record view when advance to the next step",
            "type": "boolean"
          },
          "promptBeforeAdvance": {
            "description": "allowed to pop up a confirmation dialog",
            "type": "boolean"
          },
          "conditions": {
            "description": "define conditions that the next step will appear",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowNextStepVisibilityCondition"
            }
          }
        }
      },
      "WorkflowNextStepVisibilityCondition": {
        "type": "object",
        "properties": {
          "conjugate": {
            "$ref": "#/components/schemas/ConditionConjugate"
          },
          "hierarchyType": {
            "description": "define hierarchy type when add a hierarchy condition",
            "type": "string",
            "example": "Division"
          },
          "hierarchyValue": {
            "description": "define hierarchy value when add a hierarchy condition",
            "type": "string",
            "example": "UK"
          },
          "targetField": {
            "description": "define target field when add a field condition",
            "type": "string"
          },
          "targetFieldType": {
            "$ref": "#/components/schemas/FieldType"
          },
          "roleVisible": {
            "description": "condition is true or false when add a role condition",
            "type": "boolean"
          },
          "fieldValue": {
            "description": "A list of values. A single value will be wrapped into a list by scheduled jobs. Could be any valid field values from Viking - user name(s), field option name(s), et al.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "riskRatingConditionType": {
            "$ref": "#/components/schemas/RiskRatingValue"
          },
          "riskRatingConditionValueId": {
            "description": "available when targetFieldType is RISKRATING, work together with riskRatingConditionType.",
            "type": "string"
          },
          "ordering": {
            "description": "define position in all the conditions, start with 0",
            "type": "integer",
            "format": "int64"
          },
          "negation": {
            "description": "set true when ConditionOperator is DOES_NOT_CONTAIN or IS_NOT_BLANK",
            "type": "boolean"
          },
          "checkNull": {
            "description": "set true when ConditionOperator is IS_BLANK or IS_NOT_BLANK",
            "type": "boolean"
          }
        }
      },
      "WorkflowStepRoleAccess": {
        "type": "object",
        "properties": {
          "fieldGroups": {
            "description": "name of fieldgroup to access",
            "type": "string"
          },
          "access": {
            "description": "allowed or not to access the specified fieldgroup",
            "type": "boolean"
          }
        }
      },
      "FieldGroup": {
        "type": "object",
        "properties": {
          "fieldGroupName": {
            "type": "string",
            "example": "Plan"
          },
          "parentkey": {
            "description": "not used in Viking",
            "type": "string",
            "example": ""
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Field"
            }
          },
          "visibilityConditions": {
            "description": "define conditions that the field group will appear",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldGroupVisibilityCondition"
            }
          }
        },
        "example": {
          "fieldGroupName": "Hierarchy",
          "parentkey": null,
          "fields": [
            {
              "fieldname": "Company",
              "fieldlabel": "Company",
              "fieldtype": "COMBOBOX",
              "defaultvalue": "myosh",
              "required": true,
              "searchfull": false,
              "source": {
                "from": "OPTIONS",
                "options": [
                  "myosh",
                  "New Corp Inc.",
                  "DE_Edit Inc.",
                  "ABCDE Inc.",
                  "Another Corp Inc."
                ],
                "colors": null
              },
              "validations": null,
              "visibilityConditions": null,
              "allowNewValue": false,
              "summaryField": false,
              "help": null,
              "hint": null,
              "position": 0,
              "metadata": null
            },
            {
              "fieldname": "Division",
              "fieldlabel": "Division",
              "fieldtype": "COMBOBOX",
              "defaultvalue": "Production",
              "required": true,
              "searchfull": false,
              "source": {
                "from": "OPTIONS",
                "options": [
                  "Sales",
                  "Transport",
                  "Service",
                  "Production"
                ],
                "colors": null
              },
              "validations": "null,",
              "visibilityConditions": "null,",
              "allowNewValue": "false,",
              "summaryField": "false,",
              "help": "null,",
              "hint": "null,",
              "position": "1,",
              "metadata": null
            }
          ],
          "visibilityConditions": null
        }
      },
      "Field": {
        "type": "object",
        "properties": {
          "fieldname": {
            "type": "string",
            "example": "Date"
          },
          "fieldlabel": {
            "description": "not used in Viking",
            "type": "string",
            "example": "Date"
          },
          "fieldtype": {
            "description": "default is LABEL",
            "$ref": "#/components/schemas/FieldType",
            "default": "LABEL",
            "example": "DATEFIELD"
          },
          "defaultvalue": {
            "description": "available when fieldtype is CHECKBOX, MULTISELECTPERSONFIELD, TWINCOLUMNSELECTPERSONFIELD, PERSONFIELD, TIMEFIELD, RISKRATING, READE, DATEFIELD, RSTEXTAREA, TEXTFIELD, LINK, DOUBLEFIELD, INTFIELD, GEOLOCATION and RICHTEXTAREA, MULTISELECTFIELD, OPTIONGROUP, COMBOBOX",
            "type": "string",
            "example": null
          },
          "required": {
            "description": "define this field is Mandatory or not",
            "type": "boolean",
            "example": false
          },
          "searchfull": {
            "description": "available when fieldtype is COMBOBOX",
            "type": "boolean",
            "example": false
          },
          "riskRatingValueDisplay": {
            "description": "available when fieldtype is RISKRATING",
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": []
          },
          "multiselectcheckboxtype": {
            "description": "available when fieldtype is MULTISELECTCHECKBOX",
            "type": "string",
            "enum": [
              "checkboxes",
              "buttons"
            ],
            "example": null
          },
          "targetFormId": {
            "description": "available when fieldtype is RECORDLINK or REVERSE_RECORD_LINK",
            "type": "string",
            "example": null
          },
          "targetModuleId": {
            "description": "available when fieldtype is RECORDLINK or REVERSE_RECORD_LINK",
            "type": "string",
            "example": null
          },
          "questions": {
            "description": "available when fieldtype is TEXTUAL_QUESTIONNAIRE or NUMERIC_QUESTIONNAIRE",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Question"
            },
            "example": null
          },
          "answers": {
            "description": "available when fieldtype is TEXTUAL_QUESTIONNAIRE or NUMERIC_QUESTIONNAIRE",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Answer"
            },
            "example": null
          },
          "source": {
            "$ref": "#/components/schemas/FieldSource"
          },
          "validations": {
            "description": "available when fieldtype is DATEFIELD or TEXTUAL_QUESTIONNAIRE",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldValidation"
            },
            "example": null
          },
          "visibilityConditions": {
            "description": "define conditions that the field group will appear",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldVisibilityCondition"
            },
            "example": null
          },
          "recordLinkFormat": {
            "description": "available when fieldtype is RECORDLINK",
            "type": "string",
            "example": null
          },
          "prefillFieldOnNewRecord": {
            "description": "available when fieldtype is RECORDLINK",
            "type": "boolean",
            "example": false
          },
          "recordLinkTargetPrefillValues": {
            "description": "available when fieldtype is RECORDLINK",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordLinkTargetPrefillValue"
            },
            "example": null
          },
          "recordLinkType": {
            "description": "available when fieldtype is RECORDLINK",
            "type": "string",
            "enum": [
              "LINK",
              "CLONE"
            ],
            "example": "LINK"
          },
          "allowNewValue": {
            "description": "available when fieldtype is COMBOBOX or MULTISELECTFIELD, allowed to add a new value",
            "type": "boolean",
            "example": false
          },
          "allowTextInputWhileAnsweringQuestions": {
            "description": "available when fieldtype is TEXTUAL_QUESTIONNAIRE or NUMERIC_QUESTIONNAIRE. allowed to input comments when answer questions",
            "type": "boolean",
            "example": false
          },
          "allowAttachmentsForQuestions": {
            "description": "available when fieldtype is TEXTUAL_QUESTIONNAIRE or NUMERIC_QUESTIONNAIRE. allowed to add attachments when answer questions",
            "type": "boolean",
            "example": false
          },
          "allowRecordLinksForQuestions": {
            "description": "available when fieldtype is TEXTUAL_QUESTIONNAIRE or NUMERIC_QUESTIONNAIRE. allowed to link records when answer questions",
            "type": "boolean",
            "example": false
          },
          "showSelectButton": {
            "description": "available when fieldtype is RECORDLINK or allowRecordLinksForQuestions is true",
            "type": "boolean",
            "example": false
          },
          "displayRiskLevelDescription": {
            "description": "available when fieldtype is RISKRATING. if true, display risk level description.",
            "type": "boolean",
            "example": false
          },
          "keepEmailAudit": {
            "description": "available when fieldtype is EMAIL_THIS_BUTTON, keep one copy in auditlog",
            "type": "boolean",
            "example": false
          },
          "dateField": {
            "description": "available when fieldtype is DATEFIELD and calendar view is enabled for this form, define the start day of this record",
            "type": "boolean",
            "example": false
          },
          "dateEndField": {
            "description": "available when fieldtype is DATEFIELD and calendar view is enabled for this form, define the end day of this record",
            "type": "boolean",
            "example": false
          },
          "summaryField": {
            "description": "available when fieldtype is DATEFIELD and calendar view is enabled for this form, define summary field  of this record in calendar view",
            "type": "boolean",
            "example": false
          },
          "usersLinkField": {
            "description": "available when fieldtype is PERSONFIELD, display this form in the user dialog",
            "type": "boolean",
            "example": false
          },
          "buttonCaption": {
            "description": "available when fieldtype is MULTISELECTFIELD,REVERSE_RECORD_LINK,SUMMARY_RECORD_LINK,OPTION_BUILDER,MULTISELECTCHECKBOX,TWINCOLUNSELECT,RECORDLINK and CLONERECORD",
            "type": "string",
            "example": null
          },
          "help": {
            "description": "add help or instructions for this field. this will be displayed in hover text.",
            "type": "string",
            "example": null
          },
          "hint": {
            "description": "placeholder text for this field",
            "type": "string",
            "example": null
          },
          "position": {
            "description": "define position in the field group, start with 0",
            "type": "integer",
            "format": "int64",
            "example": 0
          },
          "cloneTargetModuleId": {
            "description": "available when fieldtype is CLONERECORD",
            "type": "string",
            "example": null
          },
          "cloneTargetModuleFormId": {
            "description": "available when fieldtype is CLONERECORD",
            "type": "string",
            "example": null
          },
          "displayOption": {
            "description": "available when fieldtype is CHECKBOX",
            "type": "string",
            "enum": [
              "ICON",
              "CAPTION_TEXT",
              "TRUE_FALSE"
            ],
            "example": null
          },
          "selectedIcon": {
            "description": "available when fieldtype is CHECKBOX, define checked Icon displayed in record list",
            "type": "string",
            "example": null
          },
          "unselectedIcon": {
            "description": "available when fieldtype is CHECKBOX, define unchecked Icon displayed in record list",
            "type": "string",
            "example": null
          },
          "numberOfLines": {
            "description": "available when fieldtype is TEXTAREA, define lines contained in the textarea",
            "type": "integer",
            "example": 0
          },
          "metadata": {
            "description": "Map<String, String>, available when fieldtype is TEXTUAL_QUESTIONNAIRE or NUMERIC_QUESTIONNAIRE",
            "additionalProperties": {
              "type": "string",
              "example": null
            }
          },
          "recordLinkRecordListFields": {
            "$ref": "#/components/schemas/RecordLinkRecordListField",
            "example": null
          }
        }
      },
      "FieldGroupVisibilityCondition": {
        "type": "object",
        "properties": {
          "sourceField": {
            "description": "available when add a field condition",
            "type": "string"
          },
          "conjugate": {
            "$ref": "#/components/schemas/ConditionConjugate"
          },
          "booleanValue": {
            "description": "available when add a field condition and fieldtype is CHECKBOX",
            "type": "string"
          },
          "fieldOption": {
            "description": "available when add a field condition and fieldtype is COMBOBOX, OPTIONGROUP or MULTISELECTCHECKBOX",
            "type": "string"
          },
          "ordering": {
            "description": "define position in all the conditions, start with 0",
            "type": "integer",
            "format": "int64"
          },
          "riskRatingConditionType": {
            "$ref": "#/components/schemas/RiskRatingValue"
          },
          "riskRatingConditionValueId": {
            "description": "available when add a field condition and fieldtype is RISKRATING, work together with riskRatingConditionType",
            "type": "integer",
            "format": "int64"
          },
          "roleVisible": {
            "description": "condition is true of false when add a group condition",
            "type": "boolean"
          },
          "negation": {
            "description": "available when add a field condition or add a group condition",
            "type": "boolean"
          },
          "hierarchyType": {
            "description": "define hierarchy type when add a hierarchy condition",
            "type": "string"
          },
          "hierarchyValue": {
            "description": "define hierarchy value when add a hierarchy condition",
            "type": "string"
          }
        }
      },
      "FieldType": {
        "type": "string",
        "enum": [
          "CHECKBOX",
          "COMBOBOX",
          "CLONERECORD",
          "DATEFIELD",
          "DOUBLEFIELD",
          "EMAIL_THIS_BUTTON",
          "GEOLOCATION",
          "HISTORY",
          "INTFIELD",
          "LABEL",
          "MULTISELECTCHECKBOX",
          "MULTISELECTFIELD",
          "MULTISELECTPERSONFIELD",
          "NUMERIC_QUESTIONNAIRE",
          "OPTION_BUILDER",
          "OPTIONGROUP",
          "PDF_EXPORT",
          "PERSONFIELD",
          "READERS",
          "RECORDLINK",
          "REVERSE_RECORD_LINK",
          "RICHTEXTAREA",
          "RISKRATING",
          "SIGNATURECAPTURE",
          "SUMMARY_RECORD_LINK",
          "TEXTAREA",
          "TEXTFIELD",
          "LINK",
          "TEXTUAL_QUESTIONNAIRE",
          "TIMEFIELD",
          "TWINCOLUMNSELECT",
          "TWINCOLUMNSELECTPERSONFIELD",
          "CHECKBOX_CAPTION",
          "CHECKBOX_DEFAULT",
          "CHECKBOX_ICON"
        ]
      },
      "Question": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Unique id of a question. Referenced in QuestionWithAnswer object in Record.fieldsToQuestionWithAnswers map",
            "type": "string"
          },
          "questionText": {
            "description": "question description",
            "type": "string"
          },
          "weight": {
            "description": "weight coefficient, the score of this question is weight * score when calculating total score",
            "type": "number",
            "format": "double"
          },
          "position": {
            "description": "define position in all questions, start with 1",
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "Answer": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Unique id of an answer. Referenced in QuestionWithAnswer object in Record.fieldsToQuestionWithAnswers map"
          },
          "startInterval": {
            "description": "available when fieldtype is NUMERIC_QUESTIONNAIRE",
            "type": "integer"
          },
          "endInterval": {
            "description": "available when fieldtype is NUMERIC_QUESTIONNAIRE",
            "type": "integer"
          },
          "numericAnswer": {
            "description": "answer selected by user, available when fieldtype is NUMERIC_QUESTIONNAIRE",
            "type": "integer"
          },
          "answerText": {
            "description": "answer description, available when fieldtype is TEXTUAL_QUESTIONNAIRE",
            "type": "string",
            "example": "Yes"
          },
          "answerColor": {
            "description": "answer color, available when fieldtype is TEXTUAL_QUESTIONNAIRE",
            "type": "string",
            "example": null
          },
          "score": {
            "description": "define score for each answer, available when fieldtype is TEXTUAL_QUESTIONNAIRE",
            "type": "integer",
            "format": "int64"
          },
          "position": {
            "description": "define position in all alternative answers, start with 0",
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "FieldSource": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "enum": [
              "OPTIONS",
              "SITES",
              "KEYWORDS",
              "ALL_CONTACTS",
              "CONTACT_GROUPS",
              "CONTACT_BY_HIERARCHIES",
              "MANAGER_1_LEVEL",
              "MANAGER_2_LEVEL",
              "HIERARCHIES;"
            ],
            "example": null
          },
          "vikingLookupType": {
            "description": "available when fieldtype is COMBOBOX,MULTISELECTFIELD,OPTIONGROUP,TWINCOLUMNSELECT,MULTISELECTCHECKBOX,TWINCOLUMNSELECTPERSONFIELD,MULTISELECTPERSONFIELD,PERSONFIELD or READERS",
            "type": "string",
            "enum": [
              "NONE",
              "ALL_RECORDS_OF_FORM",
              "SPECIFIED_RECORD",
              "WITH_FIELD_KEY",
              "WITH_HIERARCHY_FIELD",
              "LINKED_RECORD"
            ],
            "example": "NONE"
          },
          "dependsOn": {
            "type": "string",
            "example": null
          },
          "keywords": {
            "type": "string",
            "example": null
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": []
          },
          "filterByGroups": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": []
          },
          "filterByHierarchy": {
            "type": "string",
            "example": null
          },
          "siteField": {
            "type": "string",
            "example": null
          },
          "colors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": []
          },
          "hierarchyType": {
            "type": "string",
            "example": null
          },
          "lookupModuleFormId": {
            "description": "define module form where current field data is from",
            "type": "string",
            "example": null
          },
          "lookupRecordId": {
            "description": "available when vikingLookupType is SPECIFIED_RECORD",
            "type": "string",
            "example": null
          },
          "lookupHierarchyTypeId": {
            "description": "available when vikingLookupType is WITH_HIERARCHY_FIELD",
            "type": "string",
            "example": null
          },
          "lookupFieldName": {
            "description": "define source field where current field data is from",
            "type": "string",
            "example": null
          },
          "lookupKeyFieldName": {
            "type": "string",
            "example": null
          },
          "lookupKeyTargetFieldName": {
            "type": "string",
            "example": null
          }
        }
      },
      "FieldValidation": {
        "type": "object",
        "properties": {
          "fieldValidationType": {
            "description": "Date ValidationType:\n\n * `DATE_BEFORE_OR_ON_TODAY` - date before or on today\n\n * `DATE_ON_OR_AFTER_TODAY` - date on or after today\n\n * `DATE_TODAY_PLUS_ONE_MONTH` - date between today and the day one month later\n\n * `DATE_TODAY_PLUS_CUSTOM_NB_OF_DAYS` - date between today and the day after specified number of days\n\nTEXTUAL_QUESTIONNAIRE ValidationType:\n\n * `ANSWER` - define validation condition according to different answers\n\n",
            "type": "string",
            "enum": [
              "DATE_BEFORE_OR_ON_TODAY",
              "DATE_ON_OR_AFTER_TODAY",
              "DATE_TODAY_PLUS_ONE_MONTH",
              "DATE_TODAY_PLUS_CUSTOM_NB_OF_DAYS",
              "ANSWER"
            ]
          },
          "answer": {
            "description": "available when fieldType is TEXTUAL_QUESTIONNAIRE",
            "type": "string"
          },
          "allowObservations": {
            "description": "available when fieldValidationType is ANSWER",
            "type": "boolean"
          },
          "allowMedia": {
            "description": "available when fieldValidationType is ANSWER",
            "type": "boolean"
          },
          "allowLinkedRecords": {
            "description": "available when fieldValidationType is ANSWER",
            "type": "boolean"
          },
          "numberOfDays": {
            "description": "available when fieldValidationType is DATE_TODAY_PLUS_CUSTOM_NB_OF_DAYS",
            "type": "string"
          }
        }
      },
      "FieldVisibilityCondition": {
        "type": "object",
        "properties": {
          "sourceField": {
            "description": "available when add a field condition",
            "type": "string"
          },
          "conjugate": {
            "$ref": "#/components/schemas/ConditionConjugate"
          },
          "booleanValue": {
            "description": "available when add a field condition and fieldtype is CHECKBOX",
            "type": "string"
          },
          "fieldOption": {
            "description": "available when add a field condition and fieldtype is COMBOBOX, OPTIONGROUP or MULTISELECTCHECKBOX",
            "type": "string"
          },
          "ordering": {
            "description": "define position in all the conditions, start with 0",
            "type": "integer",
            "format": "int64"
          },
          "riskRatingConditionType": {
            "$ref": "#/components/schemas/RiskRatingValue"
          },
          "riskRatingConditionValueId": {
            "description": "available when add a field condition and fieldtype is RISKRATING, work together with riskRatingConditionType",
            "type": "integer",
            "format": "int64"
          },
          "roleVisible": {
            "description": "condition is true of false when add a group condition",
            "type": "boolean"
          },
          "negation": {
            "description": "available when add a field condition or add a group condition",
            "type": "boolean"
          },
          "hierarchyType": {
            "description": "define hierarchy type when add a hierarchy condition",
            "type": "string"
          },
          "hierarchyValue": {
            "description": "define hierarchy value when add a hierarchy condition",
            "type": "string"
          }
        }
      },
      "ConditionConjugate": {
        "description": "Conjugate Type:\n\n * `AND` - match all conditions\n\n * `OR` - match any condition\n\n",
        "type": "string",
        "enum": [
          "AND",
          "OR"
        ]
      },
      "RiskRatingValue": {
        "type": "string",
        "enum": [
          "RATING_NAME",
          "RISK_LEVEL_NAME",
          "LIKELIHOOD_NAME",
          "CONSEQUENCE_NAME",
          "CATEGORY"
        ]
      },
      "RecordLinkRecordListField": {
        "type": "object",
        "properties": {
          "displayedFieldName": {
            "description": "linked record field name displayed in record list",
            "type": "string"
          },
          "displayOrder": {
            "description": "define position in all fields displayed in record list, the smallest value is 0",
            "type": "integer"
          },
          "optional": {
            "description": "enable to add to record list optionally",
            "type": "boolean"
          },
          "keyword": {
            "description": "set true when linked record field is keyword",
            "type": "boolean"
          }
        }
      },
      "RecordLinkTargetPrefillValue": {
        "type": "object",
        "properties": {
          "targetField": {
            "description": "available when fieldtype is COMBOBOX or OPTIONGROUP, work together with targetFieldOption",
            "type": "string",
            "example": "Sex"
          },
          "targetFieldOption": {
            "description": "field value",
            "type": "string",
            "example": "M(ale)"
          }
        }
      },
      "RiskRating": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "rating": {
            "type": "string"
          },
          "consequence": {
            "$ref": "#/components/schemas/Consequence"
          },
          "likelihood": {
            "$ref": "#/components/schemas/Likelihood"
          },
          "riskLevel": {
            "$ref": "#/components/schemas/RiskLevel"
          }
        }
      },
      "Consequence": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "position": {
            "description": "define position in all consequences, start with 1",
            "type": "integer"
          },
          "name": {
            "description": "consequence name",
            "type": "string",
            "example": "Minor"
          },
          "description": {
            "description": "consequence description",
            "type": "string",
            "example": "Consequence minor. First aid treatment, on-site release immediately contained, medium financial loss"
          }
        }
      },
      "Likelihood": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "position": {
            "description": "define position in all likelihoods, start with 1",
            "type": "integer"
          },
          "name": {
            "description": "likelihood name",
            "type": "string",
            "example": "Possible"
          },
          "description": {
            "description": "likelihood description",
            "type": "string",
            "example": "This is an occurrence which is possible.  There is a moderate chance of the event happening with a 25-55% probability. Has occurred in this organization more than 3 times in the past 10 years or occurs regularly in similar organizations or is considered to have a reasonable likelihood of occurring in the next few years."
          }
        }
      },
      "RiskLevel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "category": {
            "description": "risklevel category",
            "type": "integer",
            "example": 4
          },
          "color": {
            "description": "Text color of this RiskLevel.",
            "type": "string",
            "example": "#ff00ef"
          },
          "backgroundColor": {
            "description": "background color of this RiskLevel",
            "type": "string",
            "example": "#001100"
          },
          "name": {
            "description": "risklevel name",
            "type": "string",
            "example": "Medium - Monitor Periodically"
          },
          "description": {
            "description": "risklevel description",
            "type": "string",
            "example": "Notify Manager - Manage and Monitor Risks.  Monitor over a period of 12 months for changes that may increase this risk"
          }
        }
      },
      "Role": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "*/O=zzdm7"
          },
          "admin": {
            "type": "boolean",
            "example": false
          },
          "layoutAdmin": {
            "type": "boolean",
            "example": false
          },
          "visibleInUI": {
            "type": "boolean",
            "example": false
          },
          "restrictCreateIndividualTabs": {
            "type": "boolean",
            "example": false
          }
        }
      },
      "Site": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "unid": {
            "type": "string"
          },
          "lastModified": {
            "type": "string",
            "format": "DateTime"
          },
          "site": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "areas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "supervisors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "accountables": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "archived": {
            "type": "boolean"
          },
          "softDeleted": {
            "type": "boolean"
          }
        }
      },
      "Attachment": {
        "type": "object",
        "properties": {
          "attachmentId": {
            "type": "string",
            "example": "1"
          },
          "attachmentName": {
            "type": "string",
            "example": "openapi.json"
          },
          "attachmentUrl": {
            "type": "string",
            "description": "This url actually calls REST 2.0 API",
            "example": "https://LOCALHOST/MyoshWebBase/service/dm7/REST/2.0/file3?fileName=openapi.json&fileId=1"
          },
          "sourceID": {
            "type": "string",
            "description": "Consumer generated UUID."
          },
          "recordId": {
            "type": "string"
          },
          "author": {
            "type": "string",
            "description": "The user who posted the file."
          },
          "creationDate": {
            "type": "string"
          },
          "deleted": {
            "description": "Determine if this file has been removed from Viking; not supported in POST API.",
            "type": "boolean"
          }
        },
        "example": {
          "attachmentId": "15",
          "attachmentName": "videoplayback.mp4",
          "attachmentUrl": "https://LOCALHOST/MyoshWebBase/service/dm7/REST/2.0/file3?fileName=videoplayback.mp4&fileId=15",
          "sourceID": "15",
          "recordId": "2010",
          "author": "104",
          "creationDate": "2018-03-04T12:23:48.217Z",
          "deleted": true
        }
      },
      "Image": {
        "type": "object",
        "properties": {
          "imageName": {
            "type": "string"
          },
          "imageType": {
            "type": "string"
          },
          "isPersisted": {
            "type": "string"
          },
          "attachmentId": {
            "type": "string"
          },
          "imageBase64": {
            "type": "string"
          }
        }
      },
      "UserLocation": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "lon": {
            "type": "number",
            "format": "double"
          },
          "lat": {
            "type": "number",
            "format": "double"
          },
          "creationDateTime": {
            "type": "string",
            "format": "DateTime",
            "example": "2020-04-02T09:29:28.502Z"
          }
        }
      },
      "Location": {
        "type": "object",
        "properties": {
          "lon": {
            "type": "number",
            "format": "double"
          },
          "lat": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "PushNotification": {
        "type": "object",
        "properties": {
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Device"
            }
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PushNotificationMessage"
            }
          }
        },
        "required": [
          "messages",
          "devices"
        ]
      },
      "Device": {
        "type": "object",
        "properties": {
          "deviceLocale": {
            "type": "string",
            "example": "en_US"
          },
          "deviceType": {
            "type": "string",
            "enum": [
              "IOS",
              "ANDROID",
              "WINDOWS"
            ]
          },
          "deviceToken": {
            "description": "the device token as a UTF8 and URL encoded string",
            "type": "string",
            "example": "2deacc027920e823d55005690d86a06e39bf560b165d272cdbb674c500162907"
          }
        },
        "required": [
          "deviceType",
          "deviceToken"
        ]
      },
      "PushNotificationMessage": {
        "type": "object",
        "properties": {
          "locale": {
            "type": "string",
            "example": "en_US"
          },
          "subject": {
            "type": "string",
            "example": "NOTIFICATION_SUBJECT_REST-2"
          },
          "params": {
            "description": "Map<String, String>",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "moduleId": "MODULE_ID_1",
              "formId": "FORMD_ID_1",
              "recordNumber": "1111"
            }
          }
        }
      },
      "HierarchyValue": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "unique id of hierarchy value"
          },
          "parentValueId": {
            "type": "string",
            "description": "unique id of parent value. If parent id is specified, this hierarchy value will only be visible if the parent hierarchy value is selected"
          },
          "name": {
            "type": "string",
            "example": "Human Resource"
          },
          "names": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "list of role names of this Occupation",
              "example": "Admin"
            }
          },
          "longitude": {
            "type": "number",
            "format": "double",
            "description": "longitude of the hierarchy value's physical position"
          },
          "latitude": {
            "type": "number",
            "format": "double",
            "description": "latitude of the hierarchy value's physical position"
          },
          "archived": {
            "type": "boolean",
            "description": "Base64-encoded bytes of logo image file"
          },
          "based64Logo": {
            "type": "string",
            "description": "Base64-encoded bytes of logo image file"
          }
        },
        "required": [
          "name"
        ],
        "example": {
          "id": "1",
          "parentValueId": null,
          "name": "myosh",
          "names": null,
          "longitude": 1,
          "latitude": 0,
          "archived": false,
          "based64Logo": null
        }
      },
      "Occupation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "unique id of occupation",
            "example": "1"
          },
          "name": {
            "type": "string",
            "description": "Occupation name",
            "example": "Development Manager"
          },
          "hierarchyFieldAccess": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HierarchyField"
            }
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "list of role names of this Occupation",
              "example": "Admin"
            }
          }
        }
      },
      "OccupationRequirement": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "unique id of occupational requirement"
          },
          "occupation": {
            "type": "string",
            "description": "Occupation name"
          },
          "hierarchyFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HierarchyField"
            }
          },
          "mandatoryCompetencies": {
            "type": "array",
            "description": "mandatory competencies",
            "items": {
              "$ref": "#/components/schemas/SimpleCompetency"
            }
          },
          "desirableCompetencies": {
            "type": "array",
            "description": "desirable competencies",
            "items": {
              "$ref": "#/components/schemas/SimpleCompetency"
            }
          },
          "archived": {
            "type": "boolean"
          },
          "metadata": {
            "type": "string"
          }
        },
        "example": {
          "id": "1",
          "occupation": "developer",
          "hierarchyFields": [
            {
              "hierarchyField": "Company",
              "value": "myosh"
            }
          ],
          "mandatoryCompetencies": [
            {
              "id": "1",
              "name": "Java",
              "archived": false
            }
          ],
          "desirableCompetencies": [
            {
              "id": "1",
              "name": "JavaScript",
              "archived": false
            }
          ],
          "archived": false,
          "metadata": ""
        }
      },
      "QuestionWithAnswer": {
        "type": "object",
        "properties": {
          "answerId": {
            "type": "string",
            "description": "The id of selected answer (for TEXTUAL_QUESTIONNAIRE fields), which can be used to look up answer text, color, position and score. The id can be found in the 'answer' sub-object of the field definition included in the resposne of 'GET /modules' API",
            "example": "6"
          },
          "questionId": {
            "type": "string",
            "description": "The id of question, can be used to look up the question text and  position The id can be found in the 'question' sub-object of the field definition included in the resposne of 'GET /modules' API",
            "example": "3"
          },
          "intValue": {
            "type": "string",
            "description": "Selected integer answer (for NUMERIC_QUESTIONNAIRE fields)",
            "example": "1"
          },
          "linkedRecordIds": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "id(s) of linked record(s) for the question sepcified by questionId"
            }
          },
          "images": {
            "type": "array",
            "description": "attached images of the specified question",
            "items": {
              "$ref": "#/components/schemas/Image"
            }
          },
          "attachments": {
            "type": "array",
            "description": "attached files (not images) of the specified question",
            "items": {
              "$ref": "#/components/schemas/Attachment"
            }
          },
          "observations": {
            "type": "string",
            "description": "observations of the specified question",
            "example": "this is comment"
          }
        }
      },
      "SsoResponse": {
        "type": "object",
        "properties": {
          "sso": {
            "type": "boolean",
            "description": "true if Single Sign-on is required, false if not required"
          },
          "external_login_url": {
            "type": "string",
            "description": "The external login URL. Only displayed if sso is true,"
          }
        }
      },
      "LoginResponse": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "JWT token that can be used to authenticate user in all following REST API calls"
          },
          "loggedInUser": {
            "$ref": "#/components/schemas/User"
          },
          "theme": {
            "type": "string",
            "description": "theme name, use default theme if this property is absent or value is null"
          }
        }
      },
      "ScheduledRecord": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "workflowStep": {
            "type": "string",
            "example": "open"
          },
          "defaultSettings": {
            "type": "boolean"
          },
          "schedules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduledRecordSchedule"
            }
          },
          "fieldTriggers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduledRecordFieldTrigger"
            }
          }
        }
      },
      "ScheduledRecordSchedule": {
        "type": "object",
        "properties": {
          "schedule_type": {
            "type": "string",
            "description": "DAILY, WEEKLY, MONTHLY, YEARLY"
          },
          "hour_of_day": {
            "type": "integer",
            "description": "0 ~ 23"
          },
          "day_of_week": {
            "type": "integer",
            "description": "1(Sunday) ~ 7(Saturday)"
          },
          "day_of_month": {
            "type": "integer",
            "description": "1 ~ 31"
          },
          "month_of_year": {
            "type": "integer",
            "description": "0(JAN) ~ 11(DEC)"
          }
        },
        "example": {
          "schedule_type": "MONTHLY",
          "hour_of_day": 23,
          "day_of_month": 28
        }
      },
      "ScheduledRecordFieldTrigger": {
        "type": "object",
        "properties": {
          "fieldId": {
            "type": "integer"
          },
          "firstOccurence": {
            "type": "integer"
          },
          "repeatEvery": {
            "type": "integer"
          }
        },
        "example": {
          "fieldId": 23,
          "firstOccurence": 10000,
          "repeatEvery": 5000
        }
      },
      "SimpleCompetency": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "the name of the competency."
          },
          "archived": {
            "type": "boolean"
          }
        },
        "example": {
          "id": "1",
          "name": "JavaScript",
          "archived": false
        }
      }
    }
  }
}

