Back to Karakeep

Attach asset to a bookmark

docs/versioned_docs/version-v0.31.0/api/attach-asset-to-bookmark.api.mdx

0.31.02.5 KB
Original Source

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; import ParamsDetails from "@theme/ParamsDetails"; import RequestSchema from "@theme/RequestSchema"; import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading";

<Heading as={"h1"} className={"openapi__heading"} children={"Attach asset to a bookmark"}

</Heading>

<MethodEndpoint method={"post"} path={"/bookmarks/{bookmarkId}/assets"} context={"endpoint"}

</MethodEndpoint>

Attach a previously uploaded asset to a bookmark. The asset must be uploaded first via the POST /assets endpoint.

<Heading id={"request"} as={"h2"} className={"openapi-tabs__heading"} children={"Request"}

</Heading>

<ParamsDetails parameters={[{"schema":{"type":"string","description":"The unique identifier of the bookmark.","example":"ieidlxygmwj87oxz5hxttoc8","title":"BookmarkId"},"required":true,"name":"bookmarkId","in":"path"}]}

</ParamsDetails>

<RequestSchema title={"Body"} body={{"description":"The asset ID and type to attach.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the previously uploaded asset."},"assetType":{"type":"string","enum":["linkHtmlContent","screenshot","pdf","assetScreenshot","bannerImage","fullPageArchive","video","bookmarkAsset","precrawledArchive","userUploaded","avatar","unknown"],"description":"The type classification for this asset."}},"required":["id","assetType"]}}}}}

</RequestSchema>

<StatusCodes id={undefined} label={undefined} responses={{"201":{"description":"The asset was attached successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"assetType":{"type":"string","enum":["linkHtmlContent","screenshot","pdf","assetScreenshot","bannerImage","fullPageArchive","video","bookmarkAsset","precrawledArchive","userUploaded","avatar","unknown"]},"fileName":{"type":"string","nullable":true}},"required":["id","assetType"]}}}},"401":{"description":"Unauthorized — the Bearer token is missing, invalid, or expired.","content":{"text/plain":{"schema":{"type":"string","example":"Unauthorized"}}}},"404":{"description":"Bookmark not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"A machine-readable error code."},"message":{"type":"string","description":"A human-readable error message."}},"required":["code","message"],"title":"Error"}}}}}}

</StatusCodes>