{ "openapi": "3.0.0", "info": { "title": "Crate web companion API", "version": "1.0.0" }, "servers": [], "tags": [], "paths": { "/oauth/login": { "post": { "requestBody": { "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/LoginInput" } } }, "required": true }, "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/LoginOutput" } } }, "headers": { "SET-COOKIE": { "required": true, "deprecated": false, "schema": { "type": "string" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "operationId": "login" } }, "/api/v1/session": { "get": { "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/Session" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "session" } }, "/api/v1/logout": { "post": { "responses": { "204": { "description": "", "headers": { "SET-COOKIE": { "required": true, "deprecated": false, "schema": { "type": "string" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "operationId": "logout" } }, "/api/v1/files": { "get": { "parameters": [ { "name": "parentId", "schema": { "type": "string" }, "in": "query", "required": false, "deprecated": false, "explode": true }, { "name": "trash", "schema": { "type": "boolean" }, "in": "query", "required": false, "deprecated": false, "explode": true } ], "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/FileList" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "listFiles" }, "post": { "requestBody": { "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/CreateFile" } } }, "required": true }, "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/FileEntry" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "createFile" } }, "/api/v1/files/{id}": { "get": { "parameters": [ { "name": "id", "schema": { "type": "string" }, "in": "path", "required": true, "deprecated": false, "explode": true } ], "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/FileEntry" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "getFile" }, "put": { "parameters": [ { "name": "id", "schema": { "type": "string" }, "in": "path", "required": true, "deprecated": false, "explode": true } ], "requestBody": { "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/UpdateFile" } } }, "required": true }, "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/FileEntry" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "updateFile" } }, "/api/v1/files/{id}/duplicate": { "post": { "parameters": [ { "name": "id", "schema": { "type": "string" }, "in": "path", "required": true, "deprecated": false, "explode": true } ], "requestBody": { "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/DuplicateFile" } } }, "required": true }, "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/FileEntry" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "duplicateFile" } }, "/api/v1/files/{id}/trash": { "post": { "parameters": [ { "name": "id", "schema": { "type": "string" }, "in": "path", "required": true, "deprecated": false, "explode": true } ], "requestBody": { "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/RevisionInput" } } }, "required": true }, "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/FileEntry" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "trashFile" } }, "/api/v1/files/{id}/restore": { "post": { "parameters": [ { "name": "id", "schema": { "type": "string" }, "in": "path", "required": true, "deprecated": false, "explode": true } ], "requestBody": { "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/RevisionInput" } } }, "required": true }, "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/FileEntry" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "restoreFile" } }, "/api/v1/files/{id}/versions": { "get": { "parameters": [ { "name": "id", "schema": { "type": "string" }, "in": "path", "required": true, "deprecated": false, "explode": true } ], "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/VersionList" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "listVersions" } }, "/api/v1/files/{id}/versions/{versionId}/restore": { "post": { "parameters": [ { "name": "id", "schema": { "type": "string" }, "in": "path", "required": true, "deprecated": false, "explode": true }, { "name": "versionId", "schema": { "type": "string" }, "in": "path", "required": true, "deprecated": false, "explode": true } ], "requestBody": { "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/RevisionInput" } } }, "required": true }, "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/FileEntry" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "restoreVersion" } }, "/api/v1/files/upload": { "post": { "parameters": [ { "name": "name", "schema": { "type": "string" }, "in": "query", "required": true, "deprecated": false, "explode": true }, { "name": "parentId", "schema": { "type": "string" }, "in": "query", "required": false, "deprecated": false, "explode": true }, { "name": "mimeType", "schema": { "type": "string" }, "in": "query", "required": false, "deprecated": false, "explode": true } ], "requestBody": { "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } }, "required": true }, "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/FileEntry" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "uploadFile" } }, "/api/v1/files/{id}/content": { "put": { "parameters": [ { "name": "id", "schema": { "type": "string" }, "in": "path", "required": true, "deprecated": false, "explode": true }, { "name": "revision", "schema": { "type": "string" }, "in": "query", "required": true, "deprecated": false, "explode": true }, { "name": "mimeType", "schema": { "type": "string" }, "in": "query", "required": false, "deprecated": false, "explode": true } ], "requestBody": { "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } }, "required": true }, "responses": { "200": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/FileEntry" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "replaceContent" }, "get": { "parameters": [ { "name": "id", "schema": { "type": "string" }, "in": "path", "required": true, "deprecated": false, "explode": true }, { "name": "Range", "schema": { "type": "string" }, "in": "header", "required": false, "deprecated": false, "explode": true }, { "name": "If-Range", "schema": { "type": "string" }, "in": "header", "required": false, "deprecated": false, "explode": true } ], "responses": { "200": { "description": "", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } }, "headers": { "CONTENT-DISPOSITION": { "required": true, "deprecated": false, "schema": { "type": "string" } }, "ETAG": { "required": true, "deprecated": false, "schema": { "type": "string" } } } }, "206": { "description": "", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } }, "headers": { "CONTENT-DISPOSITION": { "required": true, "deprecated": false, "schema": { "type": "string" } }, "ETAG": { "required": true, "deprecated": false, "schema": { "type": "string" } }, "CONTENT-RANGE": { "required": true, "deprecated": false, "schema": { "type": "string" } } } }, "400": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "401": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "403": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "404": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "409": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "413": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "416": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } }, "headers": { "CONTENT-RANGE": { "required": true, "deprecated": false, "schema": { "type": "string" } } } }, "500": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "502": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "503": { "description": "", "content": { "application/json; charset=utf-8": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "Authenticated": [] } ], "operationId": "downloadFile" } } }, "components": { "schemas": { "BlobInfo": { "type": "object", "title": "BlobInfo", "required": [ "cid", "mimeType", "size" ], "properties": { "cid": { "type": "string", "description": "Content identifier of the blob, never the file identity or record revision." }, "mimeType": { "type": "string" }, "size": { "type": "integer", "format": "int64", "minimum": 0 } } }, "CreateFile": { "type": "object", "title": "CreateFile", "required": [ "name", "kind" ], "properties": { "name": { "type": "string", "maxLength": 255, "minLength": 1 }, "parentId": { "type": "string" }, "kind": { "$ref": "#/components/schemas/FileKind" } } }, "DuplicateFile": { "type": "object", "title": "DuplicateFile", "required": [ "revision", "name" ], "properties": { "revision": { "type": "string" }, "name": { "type": "string", "maxLength": 255, "minLength": 1 }, "parentId": { "type": "string" } } }, "ErrorBody": { "type": "object", "title": "ErrorBody", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } }, "FileEntry": { "type": "object", "title": "FileEntry", "required": [ "id", "uri", "revision", "name", "kind", "createdAt", "updatedAt", "size" ], "properties": { "id": { "type": "string", "description": "Stable record key within the authenticated account's drive space." }, "uri": { "type": "string" }, "revision": { "type": "string", "description": "Current record CID, used to reject stale writes." }, "parentId": { "type": "string", "description": "Omitted for a root-level entry." }, "name": { "type": "string" }, "kind": { "$ref": "#/components/schemas/FileKind" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "trashedAt": { "type": "string" }, "size": { "type": "integer", "format": "int64" }, "blob": { "$ref": "#/components/schemas/BlobInfo" } } }, "FileKind": { "type": "string", "enum": [ "file", "directory" ] }, "FileList": { "type": "object", "title": "FileList", "required": [ "files" ], "properties": { "files": { "type": "array", "items": { "$ref": "#/components/schemas/FileEntry" } } } }, "FileVersion": { "type": "object", "title": "FileVersion", "required": [ "id", "fileId", "capturedAt", "file" ], "properties": { "id": { "type": "string", "description": "Immutable version record key, distinct from the file's stable ID." }, "fileId": { "type": "string" }, "capturedAt": { "type": "string" }, "file": { "$ref": "#/components/schemas/FileEntry" } } }, "LoginInput": { "type": "object", "title": "LoginInput", "required": [ "handle" ], "properties": { "handle": { "type": "string", "minLength": 1 } } }, "LoginOutput": { "type": "object", "title": "LoginOutput", "required": [ "redirectUrl" ], "properties": { "redirectUrl": { "type": "string" } } }, "RevisionInput": { "type": "object", "title": "RevisionInput", "required": [ "revision" ], "properties": { "revision": { "type": "string" } } }, "Session": { "type": "object", "title": "Session", "required": [ "user", "space" ], "properties": { "user": { "$ref": "#/components/schemas/User" }, "space": { "$ref": "#/components/schemas/Space" } } }, "Space": { "type": "object", "title": "Space", "required": [ "uri", "authorityDid", "type", "key" ], "properties": { "uri": { "type": "string" }, "authorityDid": { "type": "string" }, "type": { "type": "string" }, "key": { "type": "string" } } }, "UpdateFile": { "type": "object", "title": "UpdateFile", "description": "Renames a file without changing its parent or stable identity.", "required": [ "revision", "name" ], "properties": { "revision": { "type": "string" }, "name": { "type": "string", "maxLength": 255, "minLength": 1 } } }, "User": { "type": "object", "title": "User", "required": [ "did", "handle" ], "properties": { "did": { "type": "string" }, "handle": { "type": "string" } } }, "VersionList": { "type": "object", "title": "VersionList", "required": [ "versions" ], "properties": { "versions": { "type": "array", "items": { "$ref": "#/components/schemas/FileVersion" } } } } }, "securitySchemes": { "Authenticated": { "type": "apiKey", "name": "crate_session", "in": "cookie" } } } }