'use client'; 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, ResponseBlock, } from '@/components/docs/blocks'; const tocItems = [ { id: 'upload-image', text: 'Upload Image', level: 2 }, { id: 'list-images', text: 'List Images', level: 2 }, { id: 'get-image', text: 'Get Image', level: 2 }, { id: 'update-image', text: 'Update Image', level: 2 }, { id: 'assign-alias', text: 'Assign Alias', level: 2 }, { id: 'delete-image', text: 'Delete Image', level: 2 }, { id: 'cdn-endpoints', text: 'CDN Endpoints', level: 2 }, { id: 'next-steps', text: 'Next Steps', level: 2 }, ]; export default function ImagesAPIPage() { return (
Upload Image

Upload an image file to your project storage.

Form Data

file, file, Yes, 'Image file (max 5MB, JPEG/PNG/WebP)', ], [ alias, string, No, 'Project-scoped alias (@custom-name)', ], [ flowId, string, No, 'Associate with flow', ], [ meta, string, No, 'Custom metadata (JSON string)', ], ]} />

Example Request

Response

List Images

Retrieve all images in your project with optional filtering.

Query Parameters

flowId, 'string', 'Filter by flow ID'], [source, 'string', 'Filter by source: generated, uploaded'], [alias, 'string', 'Filter by exact alias match'], [limit, 'number', 'Results per page (default: 20, max: 100)'], [offset, 'number', 'Number of results to skip'], ]} />

Example Request

Get Image

Retrieve a single image by ID or alias.

Example Requests

Update Image

Update image metadata (focal point and custom metadata).

Request Body

focalPoint, 'object', 'Focal point for cropping {x: 0-1, y: 0-1}'], [meta, 'object', 'Custom metadata'], ]} />

Example Request

Assign Alias

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

Request Body

alias, 'string | null', 'Alias to assign (@name) or null to remove'], ]} />

Example Requests

Delete Image

Permanently delete an image from storage.

Example Request

Deletion is permanent. The image file and all references are removed from storage.
CDN Endpoints

Access images directly via CDN (public, no authentication required):

By Image ID

By Alias

CDN URLs are public and don't require authentication. They return image bytes directly with appropriate caching headers.
); }