diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-01-04 14:03:42 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2025-01-04 14:03:42 +0000 |
| commit | 4439c91f426a8c8a13c4a84c8cb685ae67cc07e6 (patch) | |
| tree | 5704485d5ac6db9ae6900a0e0371a74736bff93c /packages/open-api/hoarder-openapi-spec.json | |
| parent | eb0d82159060ff8c278172d01725076a9eef30c0 (diff) | |
| download | karakeep-4439c91f426a8c8a13c4a84c8cb685ae67cc07e6.tar.zst | |
feat: Expose asset manipulation endpoints in the REST API
Diffstat (limited to 'packages/open-api/hoarder-openapi-spec.json')
| -rw-r--r-- | packages/open-api/hoarder-openapi-spec.json | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/packages/open-api/hoarder-openapi-spec.json b/packages/open-api/hoarder-openapi-spec.json index fecea0c2..92088f48 100644 --- a/packages/open-api/hoarder-openapi-spec.json +++ b/packages/open-api/hoarder-openapi-spec.json @@ -25,6 +25,10 @@ } }, "schemas": { + "AssetId": { + "type": "string", + "example": "ieidlxygmwj87oxz5hxttoc8" + }, "BookmarkId": { "type": "string", "example": "ieidlxygmwj87oxz5hxttoc8" @@ -435,6 +439,14 @@ } }, "parameters": { + "AssetId": { + "schema": { + "$ref": "#/components/schemas/AssetId" + }, + "required": true, + "name": "assetId", + "in": "path" + }, "BookmarkId": { "schema": { "$ref": "#/components/schemas/BookmarkId" @@ -1008,6 +1020,157 @@ } } }, + "/bookmarks/{bookmarkId}/assets": { + "post": { + "description": "Attach a new asset to a bookmark", + "summary": "Attach asset", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + } + ], + "requestBody": { + "description": "The asset to attach", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "assetType": { + "type": "string", + "enum": [ + "screenshot", + "bannerImage", + "fullPageArchive", + "video", + "bookmarkAsset", + "unknown" + ] + } + }, + "required": [ + "id", + "assetType" + ] + } + } + } + }, + "responses": { + "201": { + "description": "The attached asset", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "assetType": { + "type": "string", + "enum": [ + "screenshot", + "bannerImage", + "fullPageArchive", + "video", + "bookmarkAsset", + "unknown" + ] + } + }, + "required": [ + "id", + "assetType" + ] + } + } + } + } + } + } + }, + "/bookmarks/{bookmarkId}/assets/{assetId}": { + "put": { + "description": "Replace an existing asset with a new one", + "summary": "Replace asset", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + }, + { + "$ref": "#/components/parameters/AssetId" + } + ], + "requestBody": { + "description": "The new asset to replace with", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "assetId": { + "type": "string" + } + }, + "required": [ + "assetId" + ] + } + } + } + }, + "responses": { + "204": { + "description": "No content - asset was replaced successfully" + } + } + }, + "delete": { + "description": "Detach an asset from a bookmark", + "summary": "Detach asset", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + }, + { + "$ref": "#/components/parameters/AssetId" + } + ], + "responses": { + "204": { + "description": "No content - asset was detached successfully" + } + } + } + }, "/lists": { "get": { "description": "Get all lists", |
