Skip to main content
Boards are named collections of images. They map to the collections table in the database.

Board object

_id
Id<'collections'>
required
Unique Convex document ID for the board.
_creationTime
number
required
Timestamp (ms since epoch) when the board was created.
name
string
required
Display name of the board.
userId
Id<'users'>
required
ID of the user who owns this board.
isPublic
boolean
required
Whether the board is publicly visible. Defaults to false.
imageIds
Id<'images'>[]
required
Ordered list of image IDs in this board.
description
string
Optional description of the board.

Queries

api.boards.list

Return all boards owned by the authenticated user, newest first. No arguments. Requires authentication. Returns Board[] — array of board objects without hydrated image data.

api.boards.getById

Fetch a single board with its images fully hydrated.
id
Id<'collections'>
required
ID of the board to fetch.
Returns the board object extended with:
images
object[]
required
Full image objects for each ID in imageIds, with isLiked populated for the authenticated user. Deleted images are omitted.
Returns an error if the board does not exist or is not owned by the authenticated user.

api.boards.getBoardImages

Fetch only the images for a board, without the board metadata.
boardId
Id<'collections'>
required
ID of the board.
Returns Image[] — image objects with isLiked populated. Deleted images are omitted.

api.boards.getBoardPreviewUrls

Fetch preview image URLs for multiple boards in one call. Useful for rendering board thumbnail grids.
boardIds
Id<'collections'>[]
required
Array of board IDs to fetch preview URLs for.
limit
number
default:"4"
Maximum number of preview URLs to return per board.
Returns Record<string, string[]> — an object keyed by board ID, where each value is an array of image URLs. For each image, the URL is chosen in priority order: previewUrlderivativeUrls.mediumderivativeUrls.smallderivativeUrls.largeimageUrl. Boards that are not found or not owned by the authenticated user are omitted from the result.

Mutations

api.boards.create

Create a new board.
name
string
required
Display name for the board.
description
string
Optional description.
isPublic
boolean
default:"false"
Whether the board should be public.
Returns Id<'collections'> — the ID of the created board.

api.boards.addImage

Add an image to a board.
boardId
Id<'collections'>
required
ID of the board to add the image to.
imageId
Id<'images'>
required
ID of the image to add.
Returns
success
boolean
required
true when the image was added.
Returns an error if the image is already in the board.

api.boards.removeImage

Remove an image from a board.
boardId
Id<'collections'>
required
ID of the board.
imageId
Id<'images'>
required
ID of the image to remove.
Returns
success
boolean
required
true when the image was removed.

api.boards.update

Update board metadata. Only fields provided are changed.
boardId
Id<'collections'>
required
ID of the board to update.
name
string
New display name.
description
string
New description.
isPublic
boolean
New visibility setting.
Returns
success
boolean
required
true when the board was updated.

api.boards.deleteBoard

Permanently delete a board. Images referenced by the board are not deleted.
boardId
Id<'collections'>
required
ID of the board to delete.
Returns
success
boolean
required
true when the board was deleted.
This is irreversible. The image records themselves are not affected; only the board and its imageIds list are removed.

Build docs developers (and LLMs) love