API Reference

Packages

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 Mutation {
  installPackage(path: String!): PackageInstallPending!
  uninstallPackages(ids: [ID!]!): Boolean!
}

type Query {
  packageCount(query: String!): Int!
  packageManifest(id: ID!): String!
  packageStatuses(ids: [ID!]!): [PackageStatus!]!
  packages(query: String!, offset: Int!, limit: Int!, sortBy: FileSortBy!): [Package!]!
}

type Certificate {
	issuer: String!
	subject: String!
	serialNumber: String!
	validFrom: Instant!
	validTo: Instant!
}

enum FileSortBy {
	UPDATED_AT_ASC
	UPDATED_AT_DESC
	SIZE_ASC
	SIZE_DESC
	NAME_ASC
	NAME_DESC
}

scalar Instant

scalar Long

type Package {
	id: ID!
	name: String!
	type: PackageType!
	version: String!
	path: String!
	size: Long!
	certs: [Certificate!]!
	installedAt: Instant!
	updatedAt: Instant!
}

type PackageInstallPending {
	id: ID!
	updatedAt: Instant
	isNew: Boolean!
}

type PackageStatus {
	id: ID!
	exists: Boolean!
	updatedAt: Instant
}

enum PackageType {
	SYSTEM
	
	USER
}

Operations

mutation

installPackage

Install (or update) an APK by absolute file path. Returns the package name, last update time, and whether the package is newly installed.

graphql
mutation installPackage($path: String!) {
  installPackage(path: $path) { id updatedAt isNew }
}
mutation

uninstallPackages

Launch the system uninstall prompt for each package ID. true means the requests were initiated, not that packages were removed. The user must confirm on the device; query packageStatuses and check exists to confirm removal.

graphql
# Launch system uninstall requests; true means initiated, not uninstalled. Confirm removal with packageStatuses.
mutation uninstallPackages($ids: [ID!]!) {
  uninstallPackages(ids: $ids)
}
query

packageCount

Count packages matching a query.

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

packageManifest

Read the manifest of the specified installed package.

graphql
query packageManifest($id: ID!) {
  packageManifest(id: $id)
}
query

packageStatuses

Look up the install state and updatedAt timestamp for a list of package names.

graphql
query packageStatuses($ids: [ID!]!) {
  packageStatuses(ids: $ids) { id exists updatedAt }
}
query

packages

Search installed packages. Leave query empty to list all.

graphql
query packages($query: String!, $offset: Int!, $limit: Int!, $sortBy: FileSortBy!) {
  packages(query: $query, offset: $offset, limit: $limit, sortBy: $sortBy) { id name type version path size installedAt updatedAt }
}