{
  "openapi": "3.0.1",
  "info": {
    "title": "Pathfinder Portal API",
    "version": "v1"
  },
  "paths": {
    "/api/v1/Inspections": {
      "get": {
        "tags": [
          "Inspections"
        ],
        "summary": "Retrieve Inspection list",
        "description": "Retrieves summary information for Inspections based on the time range in which the inspections occurred, not when they were uploaded. If no time range is specified Inspections for the last 31 days will be retrieved. If an Inspection is reuploaded it's Inspection Date will not change, please use the UploadedTimestamp to determine if a new version of the Inspection is available.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "A Unix timestamp of the earliest time to query insepctions for.",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "A Unix timestamp of the latest time to query insepctions for.",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "The page number to get, defaults to 1",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "The page number to get, defaults to 100",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionSummaryPagedResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/Inspections/{id}": {
      "get": {
        "tags": [
          "Inspections"
        ],
        "summary": "Retrieves an Inspection",
        "description": "Use this endpoint to fetch a specific Inspection.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique identifier of the inspection.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inspection"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Damage": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the type of damage",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Damage information"
      },
      "HeavyWeightInspection": {
        "type": "object",
        "properties": {
          "Connection Size": {
            "type": "string",
            "description": "Connection size being inspection",
            "nullable": true
          },
          "Connection Type": {
            "type": "string",
            "description": "Connecton type being inspected",
            "nullable": true
          },
          "Remarks": {
            "type": "string",
            "description": "Remarks about the inspection",
            "nullable": true
          },
          "Type of Inspection": {
            "type": "string",
            "description": "Type of inspection being performed",
            "nullable": true
          },
          "Rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HeavyWeightInspectionItem"
            },
            "description": "The HWDP inspection items",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "HWDP Inspection Summary information"
      },
      "HeavyWeightInspectionItem": {
        "type": "object",
        "properties": {
          "Boreback Dia": {
            "type": "string",
            "nullable": true
          },
          "Boreback Length": {
            "type": "string",
            "nullable": true
          },
          "Box Bevel Dia": {
            "type": "string",
            "nullable": true
          },
          "Box Critical Length": {
            "type": "string",
            "nullable": true
          },
          "Box Length After Repair": {
            "type": "string",
            "nullable": true
          },
          "Box MPI": {
            "type": "string",
            "nullable": true
          },
          "Box OD": {
            "type": "string",
            "nullable": true
          },
          "Box Tong Space": {
            "type": "string",
            "nullable": true
          },
          "CWP OD": {
            "type": "string",
            "nullable": true
          },
          "C\"Core Depth": {
            "type": "string",
            "nullable": true
          },
          "C\"Bore Dia": {
            "type": "string",
            "nullable": true
          },
          "Damages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Damage"
            },
            "nullable": true
          },
          "Description": {
            "type": "string",
            "nullable": true
          },
          "Joint #": {
            "type": "integer",
            "format": "int32"
          },
          "Pin Bevel Dia": {
            "type": "string",
            "nullable": true
          },
          "Pin Critical Length": {
            "type": "string",
            "nullable": true
          },
          "Pin ID": {
            "type": "string",
            "nullable": true
          },
          "Pin Length After Repair": {
            "type": "string",
            "nullable": true
          },
          "Pin MPI": {
            "type": "string",
            "nullable": true
          },
          "Pin Nose Diameter": {
            "type": "string",
            "nullable": true
          },
          "Pin Tong Space": {
            "type": "string",
            "nullable": true
          },
          "Box Reface Type": {
            "type": "string",
            "nullable": true
          },
          "Pin Reface Type": {
            "type": "string",
            "nullable": true
          },
          "Seal Width": {
            "type": "string",
            "nullable": true
          },
          "Serial #": {
            "type": "string",
            "nullable": true
          },
          "Stress Relief Groove Diameter": {
            "type": "string",
            "nullable": true
          },
          "Stress Relief Groove Length": {
            "type": "string",
            "nullable": true
          },
          "Box Reface": {
            "type": "boolean"
          },
          "Pin Reface": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "Represents a single row in the Prop HWDP Inp Report"
      },
      "Inspection": {
        "type": "object",
        "properties": {
          "inspectionId": {
            "type": "string",
            "description": "The id of the Inspection",
            "nullable": true
          },
          "fileName": {
            "type": "string",
            "description": "The file name of the Inspection",
            "nullable": true
          },
          "Inspection Date": {
            "type": "string",
            "description": "The timestamp when the Inspection occurred",
            "nullable": true
          },
          "uploadTimestamp": {
            "type": "integer",
            "description": "The timestamp of when the Inspection was uploaded",
            "format": "int64"
          },
          "Field Invoice": {
            "type": "string",
            "description": "The Field Invoice Number of the Inspection",
            "nullable": true
          },
          "Operator": {
            "type": "string",
            "description": "The Operator of the Inspection",
            "nullable": true
          },
          "Contractor": {
            "type": "string",
            "description": "The Contractor of the Inspection",
            "nullable": true
          },
          "hasPipeInspectionReport": {
            "type": "boolean",
            "description": "Does this Inspection contain a Pipe Inspection report"
          },
          "hasHWDPInspectionReport": {
            "type": "boolean",
            "description": "Does this Inspection contain a HWDP Inspection report"
          },
          "hasSubsInspectionReport": {
            "type": "boolean",
            "description": "Does this Inspection contain a Subs Inspection report"
          },
          "Drill Pipe Inp Report": {
            "$ref": "#/components/schemas/PipeInspection"
          },
          "HWDP Inp Report": {
            "$ref": "#/components/schemas/HeavyWeightInspection"
          },
          "Subs Inp Report": {
            "$ref": "#/components/schemas/SubsInspection"
          }
        },
        "additionalProperties": false,
        "description": "The details of an Inspection"
      },
      "InspectionStatus": {
        "enum": [
          0,
          1,
          2,
          4,
          7
        ],
        "type": "integer",
        "format": "int32"
      },
      "InspectionSummary": {
        "type": "object",
        "properties": {
          "containsPipeInspection": {
            "type": "boolean"
          },
          "containsHeavyWeightInspection": {
            "type": "boolean"
          },
          "containsSubInspection": {
            "type": "boolean"
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdOn": {
            "type": "string",
            "format": "date-time"
          },
          "contractorName": {
            "type": "string",
            "nullable": true
          },
          "fieldInvoice": {
            "type": "string",
            "nullable": true
          },
          "heavyWeightConnectionSize": {
            "type": "string",
            "nullable": true
          },
          "heavyWeightConnectionType": {
            "type": "string",
            "nullable": true
          },
          "heavyWeightInspectionRemarks": {
            "type": "string",
            "nullable": true
          },
          "heavyWeightInspectionType": {
            "type": "string",
            "nullable": true
          },
          "inspectionDate": {
            "type": "string",
            "format": "date-time"
          },
          "inspectionId": {
            "type": "string",
            "format": "uuid"
          },
          "inspectionStatus": {
            "$ref": "#/components/schemas/InspectionStatus"
          },
          "inspectorName": {
            "type": "string",
            "nullable": true
          },
          "operatorName": {
            "type": "string",
            "nullable": true
          },
          "pipeConnectionSize": {
            "type": "string",
            "nullable": true
          },
          "pipeConnectionType": {
            "type": "string",
            "nullable": true
          },
          "pipeInspectionGrade": {
            "type": "string",
            "nullable": true
          },
          "pipeInspectionRemarks": {
            "type": "string",
            "nullable": true
          },
          "pipeInspectionType": {
            "type": "string",
            "nullable": true
          },
          "subConnectionType": {
            "type": "string",
            "nullable": true
          },
          "subInspectionRemarks": {
            "type": "string",
            "nullable": true
          },
          "subInspectionType": {
            "type": "string",
            "nullable": true
          },
          "totalHeavyWeightJointsInspected": {
            "type": "integer",
            "format": "int32"
          },
          "totalPipeJointsInspected": {
            "type": "integer",
            "format": "int32"
          },
          "totalSubJointsInspected": {
            "type": "integer",
            "format": "int32"
          },
          "reviewedOn": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "reviewedBy": {
            "type": "string",
            "nullable": true
          },
          "workbookName": {
            "type": "string",
            "nullable": true
          },
          "area": {
            "type": "string",
            "nullable": true
          },
          "drillingZone": {
            "type": "string",
            "nullable": true
          },
          "footageDrilled": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "invoiceAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "totalInspectionCost": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "InspectionSummaryPagedResult": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectionSummary"
            },
            "description": "The array of result items in the requested page",
            "nullable": true
          },
          "pageNumber": {
            "type": "integer",
            "description": "The requested page number, this number is 1-based",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "The number of pages of records matching the requested criteria",
            "format": "int32"
          },
          "totalRecords": {
            "type": "integer",
            "description": "This total number of records matching the requested criteria",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "A paged result of records"
      },
      "PipeInspection": {
        "type": "object",
        "properties": {
          "Connection Size": {
            "type": "string",
            "description": "Connection size being inspection",
            "nullable": true
          },
          "Connection Type": {
            "type": "string",
            "description": "Connecton type being inspected",
            "nullable": true
          },
          "Remarks": {
            "type": "string",
            "description": "Remarks about the inspection",
            "nullable": true
          },
          "Type of Inspection": {
            "type": "string",
            "description": "Type of inspection being performed",
            "nullable": true
          },
          "Rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PipeInspectionItem"
            },
            "description": "The Pipe inspection items",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Pipe inspection summary information"
      },
      "PipeInspectionItem": {
        "type": "object",
        "properties": {
          "Box Bevel Dia": {
            "type": "string",
            "nullable": true
          },
          "Box Critical Length": {
            "type": "string",
            "nullable": true
          },
          "Box Length After Repair": {
            "type": "string",
            "nullable": true
          },
          "Box OD": {
            "type": "string",
            "nullable": true
          },
          "Box Tong Spa": {
            "type": "string",
            "nullable": true
          },
          "C\"Bore Depth": {
            "type": "string",
            "nullable": true
          },
          "C\"Bore Dia": {
            "type": "string",
            "nullable": true
          },
          "Damages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Damage"
            },
            "nullable": true
          },
          "Joint #": {
            "type": "integer",
            "format": "int32"
          },
          "Nominal Wall Thickness": {
            "type": "number",
            "format": "double"
          },
          "OD Gage": {
            "type": "string",
            "nullable": true
          },
          "Pin Bevel Dia": {
            "type": "string",
            "nullable": true
          },
          "Pin Critical Length": {
            "type": "string",
            "nullable": true
          },
          "Pin Nose Dia": {
            "type": "string",
            "nullable": true
          },
          "Pin ID": {
            "type": "string",
            "nullable": true
          },
          "Pin Length After Repair": {
            "type": "string",
            "nullable": true
          },
          "Pin Tong Spa": {
            "type": "string",
            "nullable": true
          },
          "Box Reface Type": {
            "type": "string",
            "nullable": true
          },
          "Pin Reface Type": {
            "type": "string",
            "nullable": true
          },
          "Seal Width": {
            "type": "string",
            "nullable": true
          },
          "Serial #": {
            "type": "string",
            "nullable": true
          },
          "UT Thickness": {
            "type": "number",
            "format": "double"
          },
          "Box Reface": {
            "type": "boolean"
          },
          "Pin Reface": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "Represents a single row in the Pipe Inp Report"
      },
      "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
          }
        },
        "additionalProperties": { }
      },
      "SubsInspection": {
        "type": "object",
        "properties": {
          "Connection Type": {
            "type": "string",
            "description": "Connecton type being inspected",
            "nullable": true
          },
          "Remarks": {
            "type": "string",
            "description": "Remarks about the inspection",
            "nullable": true
          },
          "Type of Inspection": {
            "type": "string",
            "description": "Type of inspection being performed",
            "nullable": true
          },
          "Rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubsInspectionItem"
            },
            "description": "The Subs inspection items",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Subs inspection summary information"
      },
      "SubsInspectionItem": {
        "type": "object",
        "properties": {
          "Boreback Dia": {
            "type": "string",
            "nullable": true
          },
          "Boreback Length": {
            "type": "string",
            "nullable": true
          },
          "Box Bevel Dia": {
            "type": "string",
            "nullable": true
          },
          "Box MPI": {
            "type": "string",
            "nullable": true
          },
          "Box OD": {
            "type": "string",
            "nullable": true
          },
          "Box Tong Space": {
            "type": "string",
            "nullable": true
          },
          "Center Wear Pad OD": {
            "type": "string",
            "nullable": true
          },
          "Comments": {
            "type": "string",
            "nullable": true
          },
          "C\"Bore Depth": {
            "type": "string",
            "nullable": true
          },
          "C\"Bore Dia": {
            "type": "string",
            "nullable": true
          },
          "Damages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Damage"
            },
            "nullable": true
          },
          "Description": {
            "type": "string",
            "nullable": true
          },
          "Joint #": {
            "type": "integer",
            "format": "int32"
          },
          "Pin Bevel Dia": {
            "type": "string",
            "nullable": true
          },
          "Pin ID": {
            "type": "string",
            "nullable": true
          },
          "Pin MPI": {
            "type": "string",
            "nullable": true
          },
          "Pin Nose Diameter": {
            "type": "string",
            "nullable": true
          },
          "Pin Tong Space": {
            "type": "string",
            "nullable": true
          },
          "Box Reface Type": {
            "type": "string",
            "nullable": true
          },
          "Pin Reface Type": {
            "type": "string",
            "nullable": true
          },
          "Seal Width": {
            "type": "string",
            "nullable": true
          },
          "Joint Serial #": {
            "type": "string",
            "nullable": true
          },
          "Stress Relief Groove Diameter": {
            "type": "string",
            "nullable": true
          },
          "Stress Relief Groove Length": {
            "type": "string",
            "nullable": true
          },
          "Subs Connections/Data": {
            "type": "string",
            "nullable": true
          },
          "Box Reface": {
            "type": "boolean"
          },
          "Pin Reface": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "Represents a single row in the Prop Subs Inp Report"
      }
    },
    "securitySchemes": {
      "Basic": {
        "type": "http",
        "description": "Basic Authentication header",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "Basic": [ ]
    }
  ]
}