API Reference

Images

Check app.capabilities for feature support and app.access plus host permissions for authorization. Examples use synthetic values; replace paths, IDs, inputs and filters before calling.

Type Definitions

graphql
type Subscription {
  imageModelsUpdated: ImageModelsUpdate!
}

type Mutation {
  cancelImageIndex: Boolean!
  cancelImageModelDownload: Boolean!
  disableImageSearch: Boolean!
  enableImageSearch: Boolean!
  importImageSearchModel: Boolean!
  startImageIndex(force: Boolean): Boolean!
}

type Query {
  imageCount(query: String!): Int!
  imageSearchStatus: ImageSearchStatus!
  images(query: String!, offset: Int!, limit: Int!, sortBy: ImageSortBy!): [Image!]!
}

enum DataType {
	DEFAULT
	AUDIO
	VIDEO
	IMAGE
	SMS
	CONTACT
	NOTE
	FEED_ENTRY
	CALL
	PACKAGE
	FILE
	APP_FILE
	DOC
}

type Image implements MediaItem {
	id: ID!
	title: String!
	path: String!
	size: Long!
	width: Int!
	height: Int!
	rotation: Int!
	bucketId: ID!
	createdAt: Instant!
	updatedAt: Instant!
	takenAt: Instant
	isFavorite: Boolean!
	tags: [Tag!]!
}

type ImageModelsUpdate {
	version: Long!
	status: ImageSearchStatusType!
	downloadProgress: Int!
	errorMessage: String!
	modelSize: Long!
	modelDir: String!
	isIndexing: Boolean!
	totalImages: Int!
	indexedImages: Int!
}

type ImageSearchStatus {
	status: ImageSearchStatusType!
	downloadProgress: Int!
	errorMessage: String!
	modelSize: Long!
	modelDir: String!
	isIndexing: Boolean!
	totalImages: Int!
	indexedImages: Int!
}

enum ImageSearchStatusType {
	UNAVAILABLE
	DOWNLOADING
	LOADING
	READY
	ERROR
}

enum ImageSortBy {
	UPDATED_AT_ASC
	UPDATED_AT_DESC
	SIZE_ASC
	SIZE_DESC
	NAME_ASC
	NAME_DESC
	TAKEN_AT_DESC
}

scalar Instant

scalar Long

interface MediaItem {
	id: ID!
	title: String!
	path: String!
	size: Long!
	bucketId: ID!
	createdAt: Instant!
	updatedAt: Instant!
}

type Tag {
	id: ID!
	name: String!
	type: DataType!
	count: Int!
}

Operations

subscription

imageModelsUpdated

Receive image-search model download or availability updates.

graphql
subscription imageModelsUpdated {
  imageModelsUpdated { version status downloadProgress errorMessage modelSize modelDir isIndexing totalImages }
}
mutation

cancelImageIndex

Cancel the running indexing process.

graphql
mutation cancelImageIndex {
  cancelImageIndex
}
mutation

cancelImageModelDownload

Cancel the in-progress AI model download.

graphql
mutation cancelImageModelDownload {
  cancelImageModelDownload
}
mutation

disableImageSearch

Disable AI semantic image search and free up resources.

graphql
mutation disableImageSearch {
  disableImageSearch
}
mutation

enableImageSearch

Enable AI semantic image search. Downloads the on-device model if not already present.

graphql
mutation enableImageSearch {
  enableImageSearch
}
mutation

importImageSearchModel

Validate and activate a complete image-search model package that has already been uploaded.

graphql
mutation importImageSearchModel {
  importImageSearchModel
}
mutation

startImageIndex

Start indexing images for AI search. Pass force=true to re-index everything.

graphql
# `force` re-scans images that already have an embedding.
mutation startImageIndex($force: Boolean) {
  startImageIndex(force: $force)
}
query

imageCount

Count images matching a query.

graphql
query imageCount($query: String!) {
  imageCount(query: $query)
}
query

imageSearchStatus

Get the current AI semantic search indexing status.

graphql
query imageSearchStatus {
  imageSearchStatus { status downloadProgress errorMessage modelSize modelDir isIndexing totalImages indexedImages }
}
query

images

Search the image catalog with filtering, pagination and sorting.

graphql
query images($query: String!, $offset: Int!, $limit: Int!, $sortBy: ImageSortBy!) {
  images(query: $query, offset: $offset, limit: $limit, sortBy: $sortBy) { id title path size width height rotation bucketId }
}