'use client'; /** * API Reference: Image Management * * Based on docs/api/images-upload.md (CRUD sections) */ import { TipBox } from '@/components/docs/shared/TipBox'; import { Table } from '@/components/docs/shared/Table'; import { CodeBlock } from '@/components/docs/shared/CodeBlock'; import { DocPage } from '@/components/docs/layout/DocPage'; import { Hero, SectionHeader, InlineCode, EndpointCard, } from '@/components/docs/blocks'; const tocItems = [ { id: 'overview', text: 'Overview', level: 2 }, { id: 'list-images', text: 'List Images', level: 2 }, { id: 'get-image', text: 'Get Image', level: 2 }, { id: 'update-metadata', text: 'Update Metadata', level: 2 }, { id: 'assign-alias', text: 'Assign Alias', level: 2 }, { id: 'delete-image', text: 'Delete Image', level: 2 }, { id: 'response-fields', text: 'Response Fields', level: 2 }, { id: 'next-steps', text: 'Next Steps', level: 2 }, ]; const listQueryParams = [ { name: 'flowId', type: 'string', default: '-', description: 'Filter by flow UUID' }, { name: 'source', type: 'string', default: '-', description: 'Filter by source: generated, uploaded' }, { name: 'alias', type: 'string', default: '-', description: 'Filter by exact alias match' }, { name: 'limit', type: 'number', default: '20', description: 'Results per page (max: 100)' }, { name: 'offset', type: 'number', default: '0', description: 'Pagination offset' }, { name: 'includeDeleted', type: 'boolean', default: 'false', description: 'Include soft-deleted records' }, ]; const responseFields = [ ['id', 'string', 'Image UUID (same as filename in storage)'], ['projectId', 'string', 'Project UUID'], ['flowId', 'string', 'Associated flow UUID (null if none)'], ['storageUrl', 'string', 'CDN URL for direct access'], ['mimeType', 'string', 'Image MIME type'], ['fileSize', 'number', 'File size in bytes'], ['width', 'number', 'Image width in pixels'], ['height', 'number', 'Image height in pixels'], ['source', 'string', '"generated" or "uploaded"'], ['alias', 'string', 'Project-scoped alias (null if none)'], ['focalPoint', 'object', '{ x, y } coordinates (0.0-1.0)'], ['meta', 'object', 'Custom metadata'], ['createdAt', 'string', 'ISO timestamp'], ['updatedAt', 'string', 'ISO timestamp'], ]; export default function ImageManagementPage() { return ( {/* Hero Section */} {/* Overview */}
Overview

The Image Management API provides CRUD operations for images in your project. Access images by UUID or alias, update metadata, and manage aliases for easy reference.

Tip: Use aliases like @hero for human-readable references instead of UUIDs.
{/* List Images */}
List Images Query Parameters [ {param.name}, {param.type}, param.default === '-' ? - : {param.default}, param.description, ])} />
{/* Get Image */}
Get Image

Retrieve a single image by UUID or alias.

Alias Resolution: When using aliases with flowId, the system checks flow aliases first, then falls back to project aliases.
{/* Update Metadata */}
Update Metadata

Update image metadata including focal point and custom data.

Note: Alias assignment has its own dedicated endpoint.

{/* Assign Alias */}
Assign Alias

Assign or remove a project-scoped alias from an image.

Override Behavior: If another image has the alias, it loses the alias. The target image gets the alias. The old image is preserved, just unlinked.
{/* Delete Image */}
Delete Image

Permanently delete an image and its storage file.

Warning: This action is irreversible. The image record and storage file are permanently deleted. Related generations will have their outputImageId set to null.
{/* Response Fields */}
Response Fields

Complete list of fields returned in image responses:

[ {field}, {type}, description, ])} /> Accessing Images

Use storageUrl for direct CDN access:

`} language="html" filename="Usage Examples" /> Performance: UUID URLs are served directly from CDN. Alias URLs require API resolution but enable dynamic reassignment. ); }