{
  "openapi": "3.0.0",
  "paths": {
    "/health": {
      "get": {
        "operationId": "check",
        "parameters": [],
        "responses": {
          "200": {
            "description": "The Health Check is successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ok"
                    },
                    "info": {
                      "type": "object",
                      "example": {
                        "database": {
                          "status": "up"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      },
                      "nullable": true
                    },
                    "error": {
                      "type": "object",
                      "example": {},
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      },
                      "nullable": true
                    },
                    "details": {
                      "type": "object",
                      "example": {
                        "database": {
                          "status": "up"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The Health Check is not successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "error"
                    },
                    "info": {
                      "type": "object",
                      "example": {
                        "database": {
                          "status": "up"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      },
                      "nullable": true
                    },
                    "error": {
                      "type": "object",
                      "example": {
                        "redis": {
                          "status": "down",
                          "message": "Could not connect"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      },
                      "nullable": true
                    },
                    "details": {
                      "type": "object",
                      "example": {
                        "database": {
                          "status": "up"
                        },
                        "redis": {
                          "status": "down",
                          "message": "Could not connect"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "health"
        ]
      }
    },
    "/{orgKey}/signedUrl/{filePath}": {
      "get": {
        "operationId": "getSignedUrl",
        "parameters": [
          {
            "name": "orgKey",
            "required": true,
            "in": "path",
            "description": "The org orgKey, or \"shared\" for public data set or \"do-internal-data\" for internal datase",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "upload",
            "required": false,
            "in": "query",
            "description": "returns the upload url you can use to 'put' a file if set to \"true\", otherwise it will return a download URL used to 'get' a file",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filePath",
            "required": true,
            "in": "path",
            "description": "The path to the file (can include subdirectories)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully generated a signed URL for downloading/uploading the file",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "description": "The generated download/upload URL"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Files"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/{orgKey}/{filePath}": {
      "put": {
        "operationId": "putObject",
        "parameters": [
          {
            "name": "orgKey",
            "required": true,
            "in": "path",
            "description": "The org orgKey, or \"shared\" for public data set or \"do-internal-data\" for internal datase",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filePath",
            "required": true,
            "in": "path",
            "description": "The path to the file (can include subdirectories)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The file to upload"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File uploaded successfully with metadata about the uploaded file",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "eTag": {
                      "type": "string",
                      "description": "Entity tag for the uploaded file"
                    },
                    "s3": {
                      "type": "object",
                      "properties": {
                        "bucketName": {
                          "type": "string"
                        },
                        "bucketorgKey": {
                          "type": "string"
                        },
                        "bucketRegion": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Files"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "head": {
        "operationId": "headObject",
        "parameters": [
          {
            "name": "orgKey",
            "required": true,
            "in": "path",
            "description": "The org orgKey, or \"shared\" for public data set or \"do-internal-data\" for internal datasets",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filePath",
            "required": true,
            "in": "path",
            "description": "The path to the file (can include subdirectories)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved metadata for the specified file. Response has an empty body with file metadata in headers."
          }
        },
        "tags": [
          "Files"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "get": {
        "operationId": "getObject",
        "parameters": [
          {
            "name": "orgKey",
            "required": true,
            "in": "path",
            "description": "The org orgKey, or \"shared\" for public data set or \"do-internal-data\" for internal datase",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filePath",
            "required": true,
            "in": "path",
            "description": "The path to the file (can include subdirectories)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved file or directory listing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "File contents as StreamableFile"
                }
              }
            }
          }
        },
        "tags": [
          "Files"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteObject",
        "parameters": [
          {
            "name": "orgKey",
            "required": true,
            "in": "path",
            "description": "The org orgKey, or \"shared\" for public data set or \"do-internal-data\" for internal datase",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filePath",
            "required": true,
            "in": "path",
            "description": "The path to the file (can include subdirectories)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "File or directory successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "True if deletion was successful"
                }
              }
            }
          }
        },
        "tags": [
          "Files"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/{orgKey}/directory/{filePath}": {
      "get": {
        "operationId": "getObjectDirectory",
        "parameters": [
          {
            "name": "orgKey",
            "required": true,
            "in": "path",
            "description": "The org orgKey, or \"shared\" for public data set or \"do-internal-data\" for internal datase",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filePath",
            "required": true,
            "in": "path",
            "description": "The path to the file (can include subdirectories)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "last-count",
            "required": false,
            "in": "query",
            "description": "last-count is used to get the last count of objects in the bucket. This is used for pagination of the list results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "continuation-token",
            "required": false,
            "in": "query",
            "description": "ContinuationToken indicates to that the list is being continued on this bucket with a token. ContinuationToken is obfuscated and is not a real orgKey. You can use this ContinuationToken for pagination of the list results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "delimiter",
            "required": false,
            "in": "query",
            "description": "Delimiter is used to group the results by a common prefix. For example, if you set the delimiter to \"/\", the results will be grouped by the first part of the path before the \"/\".",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recursive",
            "required": false,
            "in": "query",
            "description": "if the list should be recursive, default is false and will only return the folders/file within the path",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "max-orgKeys",
            "required": false,
            "in": "query",
            "description": "max number of orgKeys to return, cannot be more than 1000",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "prefix",
            "required": false,
            "in": "query",
            "description": "path the the url",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved file or directory listing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "continuationToken": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "description": "Directory listing with optional continuation token"
                }
              }
            }
          }
        },
        "tags": [
          "Files"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    }
  },
  "info": {
    "title": "File Service",
    "description": "",
    "version": "1.0",
    "contact": {}
  },
  "tags": [],
  "servers": [],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      },
      "api-key": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "API Key Authentication"
      }
    },
    "schemas": {}
  }
}