API Reference

Media (Cross-Type)

Operations that span multiple media types (images, video, audio, docs): bucket listing, trash, restore, and bulk delete. Trash/restore require Android R+ (API 30+).

Type Definitions

bash
type MediaBucket {
  id: String!                  # media store bucket id
  name: String!                # display name (folder name)
  count: Int!
}

type ActionResult {
  type: DataType!              # the DataType the operation ran on
  query: String!               # the query that was passed in
}

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

Operations

query

mediaBuckets

List all media-store buckets for a given data type (e.g. IMAGE, VIDEO). Used to build the "Folders" view in the gallery UI.

bash
query GetMediaBuckets($type: DataType!) {
  mediaBuckets(type: $type) { id name count }
}
mutation

deleteMediaItems

Permanently delete media items matching a query. On Android R+ this deletes trashed items; on older versions it deletes matched items directly. Image index entries are also removed.

bash
mutation DeleteMediaItems($type: DataType!, $query: String!) {
  deleteMediaItems(type: $type, query: $query) { type query }
}
mutation

trashMediaItems

Move media items matching a query to the system trash. Requires Android R+. For AUDIO/VIDEO, items are also removed from the playlist.

bash
mutation TrashMediaItems($type: DataType!, $query: String!) {
  trashMediaItems(type: $type, query: $query) { type query }
}
mutation

restoreMediaItems

Restore trashed media items matching a query. Requires Android R+.

bash
mutation RestoreMediaItems($type: DataType!, $query: String!) {
  restoreMediaItems(type: $type, query: $query) { type query }
}