API Reference

Tags

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 {
  addToTags(type: DataType!, tagIds: [ID!]!, query: String!): Boolean!
  createTag(type: DataType!, name: String!): Tag!
  deleteTag(id: ID!): Boolean!
  removeFromTags(type: DataType!, tagIds: [ID!]!, query: String!): Boolean!
  updateTag(id: ID!, name: String!): Tag!
  updateTagRelations(type: DataType!, keys: [String!]!, addTagIds: [ID!]!, removeTagIds: [ID!]!): Boolean!
}

type Query {
  tagKeys(id: ID!): [String!]!
  tagRelations(type: DataType!, keys: [String!]!): [TagRelation!]!
  tags(type: DataType!): [Tag!]!
}

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

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

type TagRelation {
	tagId: ID!
	key: String!
}

Operations

mutation

addToTags

Add all items matching a query to one or more tags.

graphql
mutation addToTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
  addToTags(type: $type, tagIds: $tagIds, query: $query)
}
mutation

createTag

Create a new tag scoped to a data type.

graphql
mutation createTag($type: DataType!, $name: String!) {
  createTag(type: $type, name: $name) { id name type count }
}
mutation

deleteTag

Delete a tag and remove it from all tagged items.

graphql
mutation deleteTag($id: ID!) {
  deleteTag(id: $id)
}
mutation

removeFromTags

Remove all items matching a query from one or more tags.

graphql
mutation removeFromTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
  removeFromTags(type: $type, tagIds: $tagIds, query: $query)
}
mutation

updateTag

Rename an existing tag.

graphql
mutation updateTag($id: ID!, $name: String!) {
  updateTag(id: $id, name: $name) { id name type count }
}
mutation

updateTagRelations

Add and/or remove tags on a single item in one call.

graphql
mutation updateTagRelations($type: DataType!, $keys: [String!]!, $addTagIds: [ID!]!, $removeTagIds: [ID!]!) {
  updateTagRelations(type: $type, keys: $keys, addTagIds: $addTagIds, removeTagIds: $removeTagIds)
}
query

tagKeys

List the item keys associated with the specified tag.

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

tagRelations

Look up tag assignments for a set of item keys (e.g. media IDs, note IDs) within one data type.

graphql
query tagRelations($type: DataType!, $keys: [String!]!) {
  tagRelations(type: $type, keys: $keys) { tagId key }
}
query

tags

List all tags for the given data type.

graphql
query tags($type: DataType!) {
  tags(type: $type) { id name type count }
}