API Reference

Tags

Tags are scoped per DataType (images, audio, video, files, contacts, SMS, calls, notes). Manage tags and item assignments here.

Type Definitions

bash
type Tag {
  id: ID!
  name: String!
  count: Int!   # total items carrying this tag
}

type TagRelation {
  tagId: ID!
  key: String!  # id of the tagged item
}

# DataType scopes which content type a tag belongs to
enum DataType {
  AUDIO VIDEO IMAGE SMS CONTACT NOTE FEED_ENTRY CALL DOC PACKAGE FILE
}

# Identifies a single item by its ID key, used in updateTagRelations
input TagRelationStub {
  key: String!
}

Operations

query

tags

List all tags for the given data type.

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

tagRelations

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

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

createTag

Create a new tag scoped to a data type.

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

updateTag

Rename an existing tag.

bash
mutation UpdateTag($id: ID!, $name: String!) {
  updateTag(id: $id, name: $name) { id name }
}
mutation

deleteTag

Delete a tag and remove it from all tagged items.

bash
mutation DeleteTag($id: ID!) {
  deleteTag(id: $id)
}
mutation

addToTags

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

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

updateTagRelations

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

bash
mutation UpdateTagRelations($type: DataType!, $item: TagRelationStub!, $addTagIds: [ID!]!, $removeTagIds: [ID!]!) {
  updateTagRelations(type: $type, item: $item, addTagIds: $addTagIds, removeTagIds: $removeTagIds)
}
mutation

removeFromTags

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

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