Add an image to a library folder
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const library = await client.workspaces.library.addFolderItem({ workspaceId: '<workspaceId>', folderId: '<folderId>', type: 'image', source: 'https://media.flora.ai/example.png', text: 'A cool prompt clipped from a tweet', description: 'Product hero shot',});console.log(library);curl -X POST 'https://app.flora.ai/api/v1/workspaces/<workspaceId>/library/folders/<folderId>/items' \ -H 'Authorization: Bearer $FLORA_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "type": "image", "source": "https://media.flora.ai/example.png", "text": "A cool prompt clipped from a tweet", "description": "Product hero shot"}'Fetches an image from a public HTTPS URL (SSRF-safe) and saves it into the given library folder as a media node. Used by the Web Clipper’s send pipeline, one call per selected image. Mutating public API requests support an optional Idempotency-Key header for client retries; duplicate keys within two hours return idempotency_duplicate.
Error responses use the standard error body.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Workspace identifier
Workspace identifier
Library folder identifier
Library folder identifier
Request Body
Section titled “ Request Body ”object
Kind of item to save.
Public HTTPS URL of the image to save (required when type=image). FLORA fetches the bytes server-side with SSRF protection (private/loopback/metadata IPs and redirects to them are blocked) and stores them.
Text to save as a text node (required when type=text).
Optional caption/label for the saved item
Responses
Section titled “ Responses ”Image added to the library folder.
object
Example
{ "saved_node_id": "savednode_abc123", "folder_id": "libfolder_abc123", "asset_id": "asset_abc123", "workspace_id": "ws_abc123"}