{
"openapi": "3.0.0",
"components": {
"examples": {},
"headers": {},
"parameters": {},
"requestBodies": {},
"responses": {},
"schemas": {
"DabihInfo": {
"properties": {
"version": {
"type": "string"
},
"branding": {
"properties": {
"organization": {
"properties": {
"logo": {
"type": "string"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"logo",
"url",
"name"
],
"type": "object"
},
"department": {
"properties": {
"logo": {
"type": "string"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"logo",
"url",
"name"
],
"type": "object"
},
"contact": {
"properties": {
"phone": {
"type": "string"
},
"country": {
"type": "string"
},
"state": {
"type": "string"
},
"city": {
"type": "string"
},
"zip": {
"type": "string"
},
"street": {
"type": "string"
},
"email": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"phone",
"country",
"state",
"city",
"zip",
"street",
"email",
"name"
],
"type": "object"
},
"admin": {
"properties": {
"email": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"email",
"name"
],
"type": "object"
}
},
"required": [
"organization",
"department",
"contact",
"admin"
],
"type": "object"
}
},
"required": [
"version",
"branding"
],
"type": "object",
"additionalProperties": false
},
"PublicKey": {
"properties": {
"id": {
"description": "The database id of the public key",
"format": "bigint",
"type": "string"
},
"userId": {
"description": "The user id the key belongs to",
"format": "bigint",
"type": "string"
},
"hash": {
"type": "string"
},
"data": {
"type": "string"
},
"isRootKey": {
"type": "boolean"
},
"enabled": {
"type": "string",
"format": "date-time",
"nullable": true
},
"enabledBy": {
"type": "string",
"nullable": true
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"userId",
"hash",
"data",
"isRootKey",
"enabled",
"enabledBy",
"createdAt",
"updatedAt"
],
"type": "object",
"additionalProperties": false
},
"UserResponse": {
"properties": {
"id": {
"description": "The database id of the user",
"format": "bigint",
"type": "string"
},
"sub": {
"type": "string",
"description": "The unique user sub"
},
"email": {
"type": "string",
"description": "The email of the user"
},
"scope": {
"type": "string",
"description": "the list of scopes the user has"
},
"lastAuthAt": {
"type": "string",
"format": "date-time",
"description": "The time of the last authentication"
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "The date the user was created"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"description": "The date the user was last updated"
},
"keys": {
"items": {
"$ref": "#/components/schemas/PublicKey"
},
"type": "array",
"description": "The public keys of the user"
}
},
"required": [
"id",
"sub",
"email",
"scope",
"lastAuthAt",
"createdAt",
"updatedAt",
"keys"
],
"type": "object",
"additionalProperties": false
},
"crypto.JsonWebKey": {
"properties": {
"crv": {
"type": "string"
},
"d": {
"type": "string"
},
"dp": {
"type": "string"
},
"dq": {
"type": "string"
},
"e": {
"type": "string"
},
"k": {
"type": "string"
},
"kty": {
"type": "string"
},
"n": {
"type": "string"
},
"p": {
"type": "string"
},
"q": {
"type": "string"
},
"qi": {
"type": "string"
},
"x": {
"type": "string"
},
"y": {
"type": "string"
}
},
"type": "object",
"additionalProperties": {}
},
"UserAddBody": {
"properties": {
"sub": {
"type": "string",
"description": "The unique user sub\nif undefined the sub from the auth token will be used"
},
"email": {
"type": "string",
"description": "The email of the user"
},
"key": {
"$ref": "#/components/schemas/crypto.JsonWebKey",
"description": "The public key of the user as a JWK"
},
"isRootKey": {
"type": "boolean",
"description": "If true the key is a root key, used to decrypt all datasets"
}
},
"required": [
"email",
"key"
],
"type": "object",
"additionalProperties": false
},
"UserSub": {
"properties": {
"sub": {
"type": "string"
}
},
"required": [
"sub"
],
"type": "object",
"additionalProperties": false
},
"KeyAddBody": {
"properties": {
"sub": {
"type": "string",
"description": "The user the key should belong to"
},
"data": {
"$ref": "#/components/schemas/crypto.JsonWebKey",
"description": "The public key as a JWK"
},
"isRootKey": {
"type": "boolean",
"description": "If true the key is a root key, used to decrypt all datasets"
}
},
"required": [
"sub",
"data",
"isRootKey"
],
"type": "object",
"additionalProperties": false
},
"KeyEnableBody": {
"properties": {
"sub": {
"type": "string",
"description": "The user the key belongs to"
},
"hash": {
"type": "string",
"description": "The hash of the key"
},
"enabled": {
"type": "boolean",
"description": "The key status to set"
}
},
"required": [
"sub",
"hash",
"enabled"
],
"type": "object",
"additionalProperties": false
},
"KeyRemoveBody": {
"properties": {
"sub": {
"type": "string",
"description": "The user the key belongs to"
},
"hash": {
"type": "string",
"description": "The hash of the key"
}
},
"required": [
"sub",
"hash"
],
"type": "object",
"additionalProperties": false
},
"FileData": {
"properties": {
"id": {
"description": "The database id of the file data",
"format": "bigint",
"type": "string"
},
"uid": {
"type": "string"
},
"createdBy": {
"type": "string"
},
"fileName": {
"type": "string"
},
"filePath": {
"type": "string",
"nullable": true
},
"hash": {
"type": "string",
"nullable": true
},
"size": {
"description": "The size of the file in bytes",
"format": "bigint",
"type": "string"
},
"keyHash": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"uid",
"createdBy",
"fileName",
"filePath",
"hash",
"size",
"keyHash",
"createdAt",
"updatedAt"
],
"type": "object",
"additionalProperties": false
},
"Inode": {
"properties": {
"id": {
"description": "The database id of the inode",
"format": "bigint",
"type": "string"
},
"mnemonic": {
"type": "string"
},
"type": {
"type": "integer",
"format": "int32",
"description": "The type of the inode",
"minimum": 0
},
"name": {
"type": "string"
},
"tag": {
"type": "string",
"nullable": true
},
"dataId": {
"nullable": true,
"description": "The database id file data if the inode is a file",
"format": "bigint",
"type": "string"
},
"data": {
"allOf": [
{
"$ref": "#/components/schemas/FileData"
}
],
"nullable": true
},
"parentId": {},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"mnemonic",
"type",
"name",
"tag",
"dataId",
"parentId",
"createdAt",
"updatedAt"
],
"type": "object",
"additionalProperties": false
},
"File": {
"allOf": [
{
"$ref": "#/components/schemas/Inode"
},
{
"properties": {
"data": {
"$ref": "#/components/schemas/FileData"
}
},
"required": [
"data"
],
"type": "object"
}
]
},
"UploadStartBody": {
"properties": {
"fileName": {
"type": "string",
"description": "The name of the file to upload"
},
"directory": {
"type": "string",
"description": "The mnemonic of the directory to upload the file to"
},
"filePath": {
"type": "string",
"description": "The original path of the file"
},
"size": {
"type": "integer",
"format": "int64",
"description": "The size of the file in bytes",
"minimum": 0
},
"tag": {
"type": "string",
"description": "A custom searchable tag for the file"
}
},
"required": [
"fileName"
],
"type": "object",
"additionalProperties": false
},
"Chunk": {
"properties": {
"id": {
"description": "The database id of the chunk",
"format": "bigint",
"type": "string"
},
"dataId": {
"description": "The id of the data the chunk belongs to",
"format": "bigint",
"type": "string"
},
"hash": {
"type": "string",
"description": "The SHA-256 hash of the unencrypted chunk data base64url encoded"
},
"iv": {
"type": "string",
"description": "The AES-256 initialization vector base64url encoded"
},
"start": {
"description": "The start of the chunk as a byte position in the file",
"format": "bigint",
"type": "string"
},
"end": {
"description": "The end of the chunk as a byte position in the file",
"format": "bigint",
"type": "string"
},
"crc": {
"type": "string",
"nullable": true,
"description": "The CRC32 checksum of the encrypted chunk data base64url encoded"
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "chunk creation timestamp"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"description": "chunk last update timestamp"
}
},
"required": [
"id",
"dataId",
"hash",
"iv",
"start",
"end",
"crc",
"createdAt",
"updatedAt"
],
"type": "object",
"additionalProperties": false
},
"ChunkData": {
"allOf": [
{
"$ref": "#/components/schemas/FileData"
},
{
"properties": {
"chunks": {
"items": {
"$ref": "#/components/schemas/Chunk"
},
"type": "array"
}
},
"required": [
"chunks"
],
"type": "object"
}
]
},
"FileUpload": {
"allOf": [
{
"$ref": "#/components/schemas/File"
},
{
"properties": {
"data": {
"$ref": "#/components/schemas/ChunkData"
}
},
"required": [
"data"
],
"type": "object"
}
]
},
"Token": {
"properties": {
"id": {
"description": "The id of the token",
"format": "bigint",
"type": "string"
},
"value": {
"type": "string"
},
"sub": {
"type": "string"
},
"scope": {
"type": "string"
},
"exp": {
"type": "string",
"format": "date-time",
"nullable": true
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"value",
"sub",
"scope",
"exp",
"createdAt",
"updatedAt"
],
"type": "object",
"additionalProperties": false
},
"TokenResponse": {
"allOf": [
{
"$ref": "#/components/schemas/Token"
},
{
"properties": {
"expired": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean",
"enum": [
false
]
}
],
"description": "false if the token has not expired,\notherwise a string describing how long ago the token expired"
},
"scopes": {
"items": {
"type": "string"
},
"type": "array",
"description": "The array of scopes the token has"
}
},
"required": [
"expired",
"scopes"
],
"type": "object"
}
]
},
"TokenAddBody": {
"properties": {
"scopes": {
"items": {
"type": "string"
},
"type": "array",
"description": "The array of scopes the token should have"
},
"lifetime": {
"type": "integer",
"format": "int64",
"nullable": true,
"description": "The time in seconds the token should be valid for\nIf null the token will never expire",
"minimum": 0
}
},
"required": [
"scopes",
"lifetime"
],
"type": "object",
"additionalProperties": false
},
"JobStatus": {
"type": "string",
"enum": [
"running",
"complete",
"failed"
]
},
"Job": {
"properties": {
"jobId": {
"type": "string"
},
"status": {
"$ref": "#/components/schemas/JobStatus"
}
},
"required": [
"jobId",
"status"
],
"type": "object",
"additionalProperties": false
},
"Key": {
"properties": {
"id": {
"description": "The database id of the key",
"format": "bigint",
"type": "string"
},
"inodeId": {
"description": "The inode id the key belongs to",
"format": "bigint",
"type": "string"
},
"hash": {
"type": "string"
},
"key": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"inodeId",
"hash",
"key",
"createdAt",
"updatedAt"
],
"type": "object",
"additionalProperties": false
},
"FileDownload": {
"allOf": [
{
"$ref": "#/components/schemas/File"
},
{
"properties": {
"keys": {
"items": {
"$ref": "#/components/schemas/Key"
},
"type": "array"
},
"data": {
"$ref": "#/components/schemas/ChunkData"
}
},
"required": [
"keys",
"data"
],
"type": "object"
}
]
},
"FileKeys": {
"allOf": [
{
"$ref": "#/components/schemas/File"
},
{
"properties": {
"keys": {
"items": {
"$ref": "#/components/schemas/Key"
},
"type": "array"
}
},
"required": [
"keys"
],
"type": "object"
}
]
},
"Member": {
"properties": {
"id": {
"description": "The database id of the member",
"format": "bigint",
"type": "string"
},
"sub": {
"type": "string"
},
"inodeId": {
"description": "The database id of the inode",
"format": "bigint",
"type": "string"
},
"permission": {
"type": "number",
"format": "double"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"sub",
"inodeId",
"permission",
"createdAt",
"updatedAt"
],
"type": "object",
"additionalProperties": false
},
"InodeMembers": {
"allOf": [
{
"$ref": "#/components/schemas/Inode"
},
{
"properties": {
"members": {
"items": {
"$ref": "#/components/schemas/Member"
},
"type": "array"
}
},
"required": [
"members"
],
"type": "object"
}
]
},
"AESKey": {
"type": "string",
"description": "The AES-256 encryption key used to encrypt and decrypt datasets.\nbase64url encoded"
},
"FileDecryptionKey": {
"properties": {
"mnemonic": {
"type": "string"
},
"key": {
"$ref": "#/components/schemas/AESKey"
}
},
"required": [
"mnemonic",
"key"
],
"type": "object",
"additionalProperties": false
},
"MemberAddBody": {
"properties": {
"subs": {
"items": {
"type": "string"
},
"type": "array",
"description": "The users to add to the dataset"
},
"keys": {
"items": {
"$ref": "#/components/schemas/FileDecryptionKey"
},
"type": "array",
"description": "The list of AES-256 keys required to decrypt all child datasets"
}
},
"required": [
"subs",
"keys"
],
"type": "object",
"additionalProperties": false
},
"SetAccessBody": {
"properties": {
"sub": {
"type": "string",
"description": "The user to set the permission for"
},
"permission": {
"type": "number",
"format": "double",
"description": "The permission to set"
}
},
"required": [
"sub",
"permission"
],
"type": "object",
"additionalProperties": false
},
"InodeTree": {
"allOf": [
{
"$ref": "#/components/schemas/InodeMembers"
},
{
"properties": {
"keys": {
"items": {
"$ref": "#/components/schemas/Key"
},
"type": "array"
},
"children": {
"items": {
"$ref": "#/components/schemas/InodeTree"
},
"type": "array"
}
},
"required": [
"keys"
],
"type": "object"
}
]
},
"MoveInodeBody": {
"properties": {
"mnemonic": {
"type": "string",
"description": "The mnemonic of the inode to move"
},
"parent": {
"type": "string",
"nullable": true,
"description": "Optional: The mnemonic of the new parent directory"
},
"keys": {
"items": {
"$ref": "#/components/schemas/FileDecryptionKey"
},
"type": "array",
"description": "The list of AES-256 keys required to decrypt all child datasets"
},
"name": {
"type": "string",
"description": "Optional: The new name of the inode"
},
"tag": {
"type": "string",
"description": "Optional: The new tag of the inode"
}
},
"required": [
"mnemonic"
],
"type": "object",
"additionalProperties": false
},
"ListResponse": {
"properties": {
"parents": {
"items": {
"$ref": "#/components/schemas/InodeMembers"
},
"type": "array",
"description": "The list of parent directories"
},
"children": {
"items": {
"$ref": "#/components/schemas/InodeMembers"
},
"type": "array",
"description": "The list of inodes in the directory"
}
},
"required": [
"parents",
"children"
],
"type": "object",
"additionalProperties": false
},
"Directory": {
"properties": {
"mnemonic": {
"type": "string"
},
"name": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"mnemonic",
"name",
"createdAt",
"updatedAt"
],
"type": "object",
"additionalProperties": false
},
"AddDirectoryBody": {
"properties": {
"name": {
"type": "string",
"description": "The name of the directory"
},
"parent": {
"type": "string",
"description": "The mnemonic of the parent directory"
},
"tag": {
"type": "string",
"description": "A custom searchable tag for the directory"
}
},
"required": [
"name"
],
"type": "object",
"additionalProperties": false
},
"InodeSearchBody": {
"properties": {
"query": {
"type": "string"
}
},
"required": [
"query"
],
"type": "object",
"additionalProperties": false
},
"InodeSearchResults": {
"properties": {
"isComplete": {
"type": "boolean"
},
"inodes": {
"items": {
"$ref": "#/components/schemas/Inode"
},
"type": "array",
"description": "The list of inodes that match the search query"
}
},
"required": [
"isComplete",
"inodes"
],
"type": "object",
"additionalProperties": false
},
"IntegrityCheckResult": {
"properties": {
"missing": {
"items": {
"type": "string"
},
"type": "array",
"description": "list of file data uids that are not referenced by a corresponding bucket\nTHIS LIST SHOULD BE EMPTY if not it indicates a serious issue"
},
"unknown": {
"items": {
"type": "string"
},
"type": "array",
"description": "list of buckets that do not have corresponding filedata in the database\nthis list should be empty, if not these files are orphaned and can be removed"
}
},
"required": [
"missing",
"unknown"
],
"type": "object",
"additionalProperties": false
},
"User": {
"description": "User is the type that represents a user in the system.",
"properties": {
"sub": {
"type": "string",
"description": "The subject of the user, a unique identifier",
"example": "mhuttner"
},
"scopes": {
"items": {
"type": "string"
},
"type": "array",
"description": "The scopes the user has",
"example": [
"dabih:api"
]
},
"isAdmin": {
"type": "boolean",
"description": "Does the user have the dabih:admin scope"
}
},
"required": [
"sub",
"scopes",
"isAdmin"
],
"type": "object",
"additionalProperties": false
},
"SignInResponse": {
"properties": {
"status": {
"type": "string",
"enum": [
"success",
"email_sent",
"error"
]
},
"token": {
"type": "string"
}
},
"required": [
"status"
],
"type": "object",
"additionalProperties": false
},
"ErrorResponse": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object",
"additionalProperties": false
}
},
"securitySchemes": {
"api_key": {
"type": "http",
"name": "Authorization",
"scheme": "bearer"
}
}
},
"info": {
"title": "dabih-api",
"version": "2.2.1",
"description": "Dabih API Server",
"license": {
"name": "MIT"
},
"contact": {
"name": "Michael Huttner"
}
},
"servers": [
{
"url": "/api/v1"
}
],
"paths": {
"/healthy": {
"get": {
"operationId": "healthy",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"properties": {
"healthy": {
"type": "boolean"
}
},
"required": [
"healthy"
],
"type": "object"
}
}
}
}
},
"tags": [
"Util"
],
"security": [],
"parameters": []
}
},
"/info": {
"get": {
"operationId": "info",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DabihInfo"
}
}
}
}
},
"tags": [
"Util"
],
"security": [],
"parameters": []
}
},
"/user/add": {
"post": {
"operationId": "addUser",
"responses": {
"201": {
"description": "Created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserResponse"
}
}
}
}
},
"tags": [
"User"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserAddBody"
}
}
}
}
}
},
"/user/me": {
"get": {
"operationId": "me",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/UserResponse"
}
],
"nullable": true
}
}
}
}
},
"tags": [
"User"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": []
}
},
"/user/find": {
"post": {
"operationId": "findUser",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/UserResponse"
}
],
"nullable": true
}
}
}
}
},
"tags": [
"User"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserSub"
}
}
}
}
}
},
"/user/list": {
"get": {
"operationId": "listUsers",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/UserResponse"
},
"type": "array"
}
}
}
}
},
"tags": [
"User"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": []
}
},
"/user/remove": {
"post": {
"operationId": "removeUser",
"responses": {
"204": {
"description": "No content"
}
},
"tags": [
"User"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserSub"
}
}
}
}
}
},
"/user/key/add": {
"post": {
"operationId": "addKey",
"responses": {
"201": {
"description": "Created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublicKey"
}
}
}
}
},
"tags": [
"User"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/KeyAddBody"
}
}
}
}
}
},
"/user/key/enable": {
"post": {
"operationId": "enableKey",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublicKey"
}
}
}
}
},
"tags": [
"User"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/KeyEnableBody"
}
}
}
}
}
},
"/user/key/remove": {
"post": {
"operationId": "removeKey",
"responses": {
"204": {
"description": "No content"
}
},
"tags": [
"User"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/KeyRemoveBody"
}
}
}
}
}
},
"/upload/start": {
"post": {
"operationId": "startUpload",
"responses": {
"201": {
"description": "Created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/File"
}
}
}
}
},
"tags": [
"Upload"
],
"security": [
{
"api_key": [
"dabih:upload"
]
}
],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadStartBody"
}
}
}
}
}
},
"/upload/{mnemonic}/cancel": {
"post": {
"operationId": "cancelUpload",
"responses": {
"204": {
"description": "No content"
}
},
"tags": [
"Upload"
],
"security": [
{
"api_key": [
"dabih:upload"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/upload/{mnemonic}/finish": {
"post": {
"operationId": "finishUpload",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/File"
}
}
}
}
},
"tags": [
"Upload"
],
"security": [
{
"api_key": [
"dabih:upload"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/upload/unfinished": {
"get": {
"operationId": "unfinishedUploads",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/FileUpload"
},
"type": "array"
}
}
}
}
},
"tags": [
"Upload"
],
"security": [
{
"api_key": [
"dabih:upload"
]
}
],
"parameters": []
}
},
"/upload/cleanup": {
"post": {
"operationId": "cleanupUploads",
"responses": {
"204": {
"description": "No content"
}
},
"tags": [
"Upload"
],
"security": [
{
"api_key": [
"dabih:upload"
]
}
],
"parameters": []
}
},
"/token/add": {
"post": {
"operationId": "addToken",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenResponse"
}
}
}
}
},
"tags": [
"Token"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenAddBody"
}
}
}
}
}
},
"/token/list": {
"get": {
"operationId": "listTokens",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/TokenResponse"
},
"type": "array"
}
}
}
}
},
"tags": [
"Token"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": []
}
},
"/token/remove": {
"post": {
"operationId": "removeToken",
"responses": {
"204": {
"description": "No content"
}
},
"tags": [
"Token"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"properties": {
"tokenId": {
"type": "string"
}
},
"required": [
"tokenId"
],
"type": "object"
}
}
}
}
}
},
"/job/list": {
"get": {
"operationId": "listJobs",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/Job"
},
"type": "array"
}
}
}
}
},
"description": "List all jobs",
"tags": [
"Job"
],
"security": [
{
"api_key": [
"dabih:admin"
]
}
],
"parameters": []
}
},
"/fs/{mnemonic}/file": {
"get": {
"operationId": "fileInfo",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FileDownload"
}
}
}
}
},
"description": "Get all the file information required to download a single file",
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/fs/{mnemonic}/file/list": {
"get": {
"operationId": "listFiles",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/FileKeys"
},
"type": "array"
}
}
}
}
},
"description": "Recursively list all files in a directory",
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/fs/{mnemonic}/parent/list": {
"get": {
"operationId": "listParents",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/InodeMembers"
},
"type": "array"
}
}
}
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/fs/{mnemonic}/member/add": {
"post": {
"operationId": "addMembers",
"responses": {
"204": {
"description": "No content"
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MemberAddBody"
}
}
}
}
}
},
"/fs/{mnemonic}/member/set": {
"post": {
"operationId": "setAccess",
"responses": {
"204": {
"description": "No content"
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SetAccessBody"
}
}
}
}
}
},
"/fs/{mnemonic}/duplicate": {
"post": {
"operationId": "duplicateInode",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Inode"
}
}
}
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/fs/{mnemonic}/remove": {
"post": {
"operationId": "removeInode",
"responses": {
"204": {
"description": "No content"
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/fs/{mnemonic}/destroy": {
"post": {
"operationId": "destroyInode",
"responses": {
"204": {
"description": "No content"
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/fs/{mnemonic}/tree": {
"get": {
"operationId": "inodeTree",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InodeTree"
}
}
}
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/fs/resolve/{path}": {
"get": {
"operationId": "resolvePath",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/Inode"
}
],
"nullable": true
}
}
}
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "path",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/fs/resolve": {
"get": {
"operationId": "resolveHome",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/Inode"
}
],
"nullable": true
}
}
}
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": []
}
},
"/fs/move": {
"post": {
"operationId": "moveInode",
"responses": {
"204": {
"description": "No content"
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MoveInodeBody"
}
}
}
}
}
},
"/fs/list": {
"get": {
"operationId": "listHome",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ListResponse"
}
}
}
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": []
}
},
"/fs/{mnemonic}/list": {
"get": {
"operationId": "listInodes",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ListResponse"
}
}
}
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/fs/directory/add": {
"post": {
"operationId": "addDirectory",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Directory"
}
}
}
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AddDirectoryBody"
}
}
}
}
}
},
"/fs/search": {
"post": {
"operationId": "searchFs",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"properties": {
"jobId": {
"type": "string"
}
},
"required": [
"jobId"
],
"type": "object"
}
}
}
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InodeSearchBody"
}
}
}
}
}
},
"/fs/search/{jobId}": {
"post": {
"operationId": "searchResults",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InodeSearchResults"
}
}
}
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "jobId",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/fs/search/{jobId}/cancel": {
"post": {
"operationId": "searchCancel",
"responses": {
"204": {
"description": "No content"
}
},
"tags": [
"Filesystem"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "jobId",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/filedata/orphaned": {
"get": {
"operationId": "listOrphaned",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/FileData"
},
"type": "array"
}
}
}
}
},
"description": "Find all file data entries that are not referenced by any inode",
"tags": [
"File Data"
],
"security": [
{
"api_key": [
"dabih:admin"
]
}
],
"parameters": []
}
},
"/filedata/{uid}/remove": {
"post": {
"operationId": "removeFileData",
"responses": {
"204": {
"description": "No content"
}
},
"tags": [
"File Data"
],
"security": [
{
"api_key": [
"dabih:admin"
]
}
],
"parameters": [
{
"in": "path",
"name": "uid",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/filedata/checkIntegrity": {
"get": {
"operationId": "checkIntegrity",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IntegrityCheckResult"
}
}
}
}
},
"tags": [
"File Data"
],
"security": [
{
"api_key": [
"dabih:admin"
]
}
],
"parameters": []
}
},
"/download/{mnemonic}/decrypt": {
"post": {
"operationId": "decryptDataset",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenResponse"
}
}
}
}
},
"tags": [
"Download"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"properties": {
"key": {
"$ref": "#/components/schemas/AESKey"
}
},
"required": [
"key"
],
"type": "object"
}
}
}
}
}
},
"/download": {
"get": {
"operationId": "downloadDataset",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"type": "string",
"format": "byte"
}
}
}
}
},
"tags": [
"Download"
],
"security": [
{
"api_key": []
}
],
"parameters": []
}
},
"/download/{uid}/chunk/{hash}": {
"get": {
"operationId": "downloadChunk",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "byte"
}
}
}
}
},
"tags": [
"Download"
],
"security": [
{
"api_key": [
"dabih:api"
]
}
],
"parameters": [
{
"in": "path",
"name": "uid",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "hash",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/auth/info": {
"get": {
"operationId": "authInfo",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
}
},
"tags": [
"Auth"
],
"security": [
{
"api_key": []
}
],
"parameters": []
}
},
"/auth/signIn": {
"post": {
"operationId": "signIn",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SignInResponse"
}
}
}
}
},
"tags": [
"Auth"
],
"security": [],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"properties": {
"email": {
"type": "string"
}
},
"required": [
"email"
],
"type": "object"
}
}
}
}
}
},
"/auth/verify": {
"post": {
"operationId": "verifyEmail",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
},
"500": {
"description": "Unknown error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
},
"tags": [
"Auth"
],
"security": [],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"properties": {
"token": {
"type": "string"
}
},
"required": [
"token"
],
"type": "object"
}
}
}
}
}
},
"/auth/refresh": {
"post": {
"operationId": "refreshToken",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
}
},
"tags": [
"Auth"
],
"security": [],
"parameters": []
}
},
"/upload/{mnemonic}/chunk": {
"put": {
"operationId": "chunkUpload",
"responses": {
"201": {
"description": "Created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Chunk"
}
}
}
}
},
"tags": [
"Upload"
],
"security": [
{
"api_key": [
"dabih:upload"
]
}
],
"parameters": [
{
"in": "path",
"name": "mnemonic",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "The range of bytes in the chunk\nIt should be in the format `bytes {start}-{end}/{size?}`",
"in": "header",
"name": "content-range",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "The SHA-256 hash of the chunk data encoded in base64url\nIt should be in the format `sha-256={hash}`",
"in": "header",
"name": "digest",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"chunk": {
"type": "string",
"format": "binary"
}
}
}
},
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
}
}