{
  "openapi": "3.0.1",
  "info": {
    "title": "Omaha API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://ip-pod-dev14-omaha.azurewebsites.net/"
    }
  ],
  "paths": {
    "/v1/workplaces/{id}": {
      "get": {
        "tags": [
          "Workplace"
        ],
        "operationId": "GetWorkplace",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workplace"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "omaha"
            ],
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/persons/{id}": {
      "get": {
        "tags": [
          "Person"
        ],
        "operationId": "GetPerson",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Person"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "omaha"
            ],
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/organisations/{id}": {
      "get": {
        "tags": [
          "Organisation"
        ],
        "operationId": "GetOrganisation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organisation"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "omaha"
            ],
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/orders/{id}": {
      "get": {
        "tags": [
          "Order"
        ],
        "operationId": "GetOrder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "omaha"
            ],
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/offices/{id}": {
      "get": {
        "tags": [
          "Office"
        ],
        "operationId": "GetOffice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Office"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "omaha"
            ],
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/contacts/{id}": {
      "get": {
        "tags": [
          "Contact"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "omaha"
            ],
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/absence-codes/{id}": {
      "get": {
        "tags": [
          "AbsenceCode"
        ],
        "operationId": "GetAbsenceCode",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AbsenceCode"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "omaha"
            ],
            "ApiKey": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "AbsenceCode"
        ],
        "operationId": "PatchAbsenceCode",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAbsenceCodeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAbsenceCodeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAbsenceCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AbsenceCode"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "omaha"
            ],
            "ApiKey": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AbsenceCode": {
        "required": [
          "id",
          "name",
          "description",
          "category",
          "ruleType",
          "refWeeksQty",
          "isArchived",
          "allowConsultantTimeReport",
          "dayToArticle1",
          "dayToArticle2",
          "exportCode",
          "allowForMonthlySalary",
          "allowForGuaranteeSalary",
          "allowForHourlySalary",
          "allowForSubContractor"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "ruleType": {
            "type": "string",
            "nullable": true
          },
          "refWeeksQty": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "isArchived": {
            "type": "boolean",
            "nullable": true
          },
          "allowConsultantTimeReport": {
            "type": "boolean",
            "nullable": true
          },
          "dayToArticle1": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "dayToArticle2": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "exportCode": {
            "type": "string",
            "nullable": true
          },
          "allowForMonthlySalary": {
            "type": "boolean",
            "nullable": true
          },
          "allowForGuaranteeSalary": {
            "type": "boolean",
            "nullable": true
          },
          "allowForHourlySalary": {
            "type": "boolean",
            "nullable": true
          },
          "allowForSubContractor": {
            "type": "boolean",
            "nullable": true
          }
        }
      },
      "Contact": {
        "required": [
          "id",
          "firstName",
          "lastName",
          "note",
          "email",
          "phone",
          "mobilePhone",
          "role",
          "title",
          "linkedInUrl",
          "active",
          "portalUser"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "note": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "mobilePhone": {
            "type": "string",
            "nullable": true
          },
          "role": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "linkedInUrl": {
            "type": "string",
            "nullable": true
          },
          "active": {
            "type": "boolean",
            "nullable": true
          },
          "portalUser": {
            "type": "boolean",
            "nullable": true
          }
        }
      },
      "Office": {
        "required": [
          "id",
          "name",
          "fixedPhone",
          "preStreetAddress",
          "streetAddress",
          "postStreetAddress",
          "zipCode",
          "city",
          "countryCode"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "fixedPhone": {
            "type": "string",
            "nullable": true
          },
          "preStreetAddress": {
            "type": "string",
            "nullable": true
          },
          "streetAddress": {
            "type": "string",
            "nullable": true
          },
          "postStreetAddress": {
            "type": "string",
            "nullable": true
          },
          "zipCode": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Order": {
        "required": [
          "id",
          "description",
          "orderType",
          "isActive",
          "staffingServiceAlias",
          "recruitmentEnabled",
          "staffingState"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "orderType": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean",
            "nullable": true
          },
          "staffingServiceAlias": {
            "type": "string",
            "nullable": true
          },
          "recruitmentEnabled": {
            "type": "boolean",
            "nullable": true
          },
          "staffingState": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Organisation": {
        "required": [
          "id",
          "name",
          "treeLevel",
          "resultAccount",
          "canContainSalesAccount",
          "canContainCustOrder",
          "canContainOpportunity",
          "canContainEmployee",
          "descendantCount"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "treeLevel": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "resultAccount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "canContainSalesAccount": {
            "type": "boolean",
            "nullable": true
          },
          "canContainCustOrder": {
            "type": "boolean",
            "nullable": true
          },
          "canContainOpportunity": {
            "type": "boolean",
            "nullable": true
          },
          "canContainEmployee": {
            "type": "boolean",
            "nullable": true
          },
          "descendantCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        }
      },
      "Person": {
        "required": [
          "id",
          "employmentNo",
          "firstName",
          "surName",
          "email",
          "workPhone",
          "homePhone",
          "mobilePhone",
          "otherPhone",
          "preStreetAddress",
          "streetAddress",
          "postStreetAddress",
          "zipCode",
          "city"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "employmentNo": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "surName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "workPhone": {
            "type": "string",
            "nullable": true
          },
          "homePhone": {
            "type": "string",
            "nullable": true
          },
          "mobilePhone": {
            "type": "string",
            "nullable": true
          },
          "otherPhone": {
            "type": "string",
            "nullable": true
          },
          "preStreetAddress": {
            "type": "string",
            "nullable": true
          },
          "streetAddress": {
            "type": "string",
            "nullable": true
          },
          "postStreetAddress": {
            "type": "string",
            "nullable": true
          },
          "zipCode": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "UpdateAbsenceCodeRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "default": null,
            "nullable": true
          },
          "description": {
            "type": "string",
            "default": null,
            "nullable": true
          },
          "category": {
            "type": "string",
            "default": null,
            "nullable": true
          },
          "ruleType": {
            "type": "string",
            "default": null,
            "nullable": true
          },
          "refWeeksQty": {
            "type": "integer",
            "format": "int32",
            "default": null,
            "nullable": true
          },
          "isArchived": {
            "type": "boolean",
            "default": null,
            "nullable": true
          },
          "allowConsultantTimeReport": {
            "type": "boolean",
            "default": null,
            "nullable": true
          },
          "dayToArticle1": {
            "type": "integer",
            "format": "int32",
            "default": null,
            "nullable": true
          },
          "dayToArticle2": {
            "type": "integer",
            "format": "int32",
            "default": null,
            "nullable": true
          },
          "exportCode": {
            "type": "string",
            "default": null,
            "nullable": true
          },
          "allowForMonthlySalary": {
            "type": "boolean",
            "default": null,
            "nullable": true
          },
          "allowForGuaranteeSalary": {
            "type": "boolean",
            "default": null,
            "nullable": true
          },
          "allowForHourlySalary": {
            "type": "boolean",
            "default": null,
            "nullable": true
          },
          "allowForSubContractor": {
            "type": "boolean",
            "default": null,
            "nullable": true
          }
        }
      },
      "Workplace": {
        "required": [
          "id",
          "name",
          "orgNumber",
          "active",
          "headquarter",
          "supplier",
          "orgUnitId",
          "customerGroupId",
          "legalCompanyId",
          "parentId",
          "customerId",
          "phone",
          "note",
          "createdDate",
          "modifiedDate"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "orgNumber": {
            "type": "string",
            "nullable": true
          },
          "active": {
            "type": "boolean",
            "nullable": true
          },
          "headquarter": {
            "type": "boolean",
            "nullable": true
          },
          "supplier": {
            "type": "boolean",
            "nullable": true
          },
          "orgUnitId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "customerGroupId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "legalCompanyId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "parentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "customerId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "note": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://900488.idp.intelliplan.eu/connect/authorize",
            "tokenUrl": "https://900488.idp.intelliplan.eu/connect/token",
            "scopes": {
              "omaha": "Access Omaha API"
            }
          }
        }
      },
      "ApiKey": {
        "type": "apiKey",
        "description": "Required for Omaha business API calls.",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  },
  "tags": [
    {
      "name": "Workplace"
    },
    {
      "name": "Person"
    },
    {
      "name": "Organisation"
    },
    {
      "name": "Order"
    },
    {
      "name": "Office"
    },
    {
      "name": "Contact"
    },
    {
      "name": "AbsenceCode"
    }
  ]
}