Image object
Every query that returns images includes these fields.Unique Convex document ID for the image.
Display title of the image.
Public URL of the full-resolution original image.
Array of descriptive tags. Uploads always include
"original".Visual category (e.g.
"Cinematic", "Film", "Landscape").ID of the user who uploaded or imported the image.
Total like count.
Total view count.
Whether the authenticated caller has liked this image. Always
false for unauthenticated requests.AI-generated or user-provided description.
URL of the preview-sized image (640×360 WebP).
Temporary Convex storage ID. Present only during upload before NextCloud finalization.
Original source attribution string (e.g.
"AI Generation").Style reference string passed to generation models.
Array of five hex color codes extracted by VLM analysis.
Lifecycle status. One of
draft, pending, or active.AI processing status. One of
queued, processing, completed, or failed.Project type group. One of:
Commercial, Film, Moodboard, Spec Commercial, Spec Music Video, Music Video, TV Series, Web Series, Video Game Cinematic.Name of the production project this image belongs to.
Name of the moodboard this image belongs to (reference images only).
ID of the source image this was generated from (AI variations only).
Origin of the image. One of:
upload, discord, pinterest, ai.NextCloud upload status. One of
pending, succeeded, or failed.Public URLs for resized derivative images.
Queries
api.images.list
Returns a page of active images, optionally filtered by category and/or group.
Filter to images whose
category exactly matches this value.Filter to images whose
group exactly matches this value.Maximum number of images to return. Defaults to 50.
Image[] — array of image objects with isLiked populated for the authenticated user.
api.images.search
Full-text search across image titles, with optional category and group filters.
Text to search for in image titles.
Restrict results to this category.
Restrict results to this group.
Image[] — up to 50 matching images with isLiked populated. Only active images are returned.
api.images.getById
Fetch a single image by its ID.
The Convex document ID of the image.
Image | null — the image with isLiked populated, or null if not found.
api.images.getGroups
Returns the list of valid group values.
No arguments.
Returns string[] — the following values in order:
api.images.getCategories
Returns all known categories, combining built-in defaults with any categories already used in the database.
No arguments.
Returns string[] — sorted array of category strings. Built-in defaults include Abstract, Architecture, Art, Blockbuster Film, Character Design, Cinematic, Commercial, Design, Environment, Fashion, Film, Gaming, Headshot, Indy Film, Illustration, Interior, Landscape, Photography, Sci-Fi, Streetwear, Technology, Texture, UI/UX, Vintage.
api.images.getDraftImages
Returns draft images owned by the authenticated user.
No arguments. Requires authentication.
Returns Image[] — images with status: "draft", newest first.
api.images.getProcessingImages
Returns images with aiStatus: "processing" that were uploaded within the last 18 hours.
No arguments. Requires authentication.
Images older than 18 hours are excluded from the active processing queue even if their
aiStatus has not been updated. Use api.images.clearMyStaleProcessingImages to mark stale records as failed.Image[] — processing images from the last 18 hours.
api.images.getPendingImages
Returns images with status: "pending" (awaiting approval) owned by the authenticated user.
No arguments. Requires authentication.
Returns Image[] — pending images, newest first.
Mutations
api.images.create
Create a new image record directly from a URL. Use this for simple imports where you already have a hosted URL.
Display title for the image.
Publicly accessible URL of the image.
Tags describing the image. The tag
"original" is appended automatically.Visual category for the image.
Optional description.
Source attribution string.
Style reference string.
Id<'images'> — the ID of the created image.
api.images.createExternal
Create an image record from an external import (Discord, Pinterest, or AI) with full metadata and deduplication.
If a record with the same externalId already exists, the existing ID is returned immediately. If a record with the same imageUrl already exists for the current user, that ID is returned instead.
Display title. Defaults to
"Untitled" if empty.Publicly accessible URL of the full image.
Optional description.
URL of a smaller preview version.
Tags. Defaults to
["original"].Visual category. Defaults to
"General".Source attribution.
Style reference string.
Relative NextCloud WebDAV path of the stored original (e.g.
pindeck/media-uploads/2024/12_01/original/image.jpg). Path traversal sequences are rejected.NextCloud path of the preview file.
Pre-computed public URLs for derivatives.
NextCloud paths for derivative files.
External platform ID for deduplication (e.g. a Discord message attachment ID).
Origin of the image. One of:
upload, discord, pinterest, ai.Original source URL before any processing.
ID of the import batch this image belongs to.
Id<'images'> — the ID of the created or existing image.
Discord imports (
sourceType: "discord") are created with status: "pending" and aiStatus: "queued". All other source types are created as status: "active" with aiStatus: "processing", and VLM analysis is scheduled immediately.api.images.generateUploadUrl
Generates a pre-signed Convex storage upload URL. Use this before calling api.images.uploadMultiple.
No arguments. Requires authentication.
Returns string — a short-lived upload URL. Upload your image file to this URL with a PUT request.
api.images.uploadMultiple
Create image records from one or more Convex storage uploads. Each image is created as a draft and the system schedules NextCloud finalization and VLM analysis automatically.
Array of upload descriptors.
Id<'images'>[] — array of created image IDs, in the same order as the input uploads array.
api.images.finalizeUploads
Promote draft images to active status. Call this after the user confirms their upload batch is complete.
IDs of the draft images to activate. Only images owned by the authenticated user are updated.
null
api.images.toggleLike
Toggle the authenticated user’s like on an image.
ID of the image to like or unlike.
boolean — true if the image is now liked, false if it is now unliked.
api.images.incrementViews
Increment the view counter for an image. Call this when an image is displayed to a user.
ID of the image that was viewed.
null
api.images.remove
Permanently delete an image and its associated storage files. Only the image owner can delete it.
ID of the image to delete.
true when the image was deleted.api.images.approveImage
Approve a pending or draft image. For Discord-sourced images, this transitions the image to draft and triggers VLM analysis. For all other sources, the image transitions directly to active.
ID of the image to approve.
null
api.images.rejectImage
Reject and permanently delete an image. Only the image owner can reject it.
ID of the image to reject.
null
api.images.clearMyStaleProcessingImages
Mark stale processing images as failed. Useful for cleaning up stuck AI jobs.
Images with
uploadedAt older than this many hours are marked as failed. Minimum is 1 hour.number — count of images updated from processing to failed.
api.images.backfillGenerationsFromAiImages
Backfill generations records for AI-generated images that predate the generations table. Scans the authenticated user’s images for those tagged "generated" or sourced as "AI Generation" and inserts missing records.
Maximum number of images to scan. Capped at 2000.
Number of AI images found in the scan.
Number of new generation records created.
Number of images skipped because a generation record already existed.
api.images.updateImageMetadata
Update editable metadata fields on an existing image. Only fields that are provided are changed — omitted fields are left unchanged. Any authenticated user can update metadata on any image (curation tool behavior).
ID of the image to update.
New display title.
New description.
Replacement tag array.
New category value.
New source attribution.
New style reference string.
Replacement color palette (hex codes).
New project type group.
New project name.
New moodboard name.
New unique identifier.
true when the update was applied.api.images.setAiStatus
Manually set an image’s aiStatus to completed or failed. Use this to unstick images that are stuck in processing.
ID of the image to update. Must be owned by the authenticated user.
One of
"completed" or "failed".null
api.images.setProjectRowOrder
Reorder images within a project row and optionally move images to a different project. Called by the gallery’s drag-and-drop project row view.
The project name to assign all images to.
Ordered list of image IDs. Each image’s
projectOrder is set to its index in this array, and its projectName is set to the provided value.null
api.images.backfillNextcloudFailedUploads
Reschedule NextCloud persistence for images still in Convex storage. Targets images where sourceType = "upload", storageProvider = "convex", and storageId is still present.
Maximum number of images to reschedule. Capped at 200.
Number of images for which NextCloud finalization was rescheduled.