≡ messages.tags API
≡ Add-on developer resources
≡ Guides
messages.tags API
The messages.tags API allows to manage the user’s message tags.
Permissions
The following permissions influence the behavior of the API. Depending on which permissions are requested, additional methods might be available, or certain data may be included in responses.
Hint
Request permissions only when needed. Unnecessary requests may result in rejection during ATN review.
accountsRead
See your mail accounts, their identities and their folders.
messagesTags
Create, modify and delete message tags.
messagesTagsList
List message tags.
Functions
create([key], tag, color, [callback])
– [Added in TB 121]
Creates a new message tag and returns the associated key. Tagging a message will store the tag’s key in the user’s message. Throws if the specified tag key is used already.
Parameters
key
Unique tag identifier (will be converted to lower case). Must not include ()<>{/%*” or spaces. Will be auto-generated if not provided.
tag
Human-readable tag name.
color
Tag color in hex format (i.e.: #000080 for navy blue).
callback
Required permissions
messagesTags
delete(key)
– [Added in TB 121]
Deletes a message tag, removing it from the list of known tags. Its key will not be removed from tagged messages, but they will appear untagged. Recreating a deleted tag, will make all former tagged messages appear tagged again.
Parameters
key
Unique tag identifier (will be converted to lower case). Must not include ()<>{/%*” or spaces.
Required permissions
messagesTags
list()
– [Added in TB 121]
Returns a list of tags that can be set on messages, and their human-friendly name, colour, and sort order.
Required permissions
messagesTagsList
update(key, updateProperties)
– [Added in TB 121]
Updates a message tag. Throws if the specified tag key does not exist.
Parameters
key
Unique tag identifier (will be converted to lower case). Must not include ()<>{/%*” or spaces.
updateProperties
Required permissions
messagesTags
Events
onCreated
– [Added in TB 136]
Fired when a new message tag has been created.
Parameters for onCreated.addListener(listener)
listener(tag)
A function that will be called when this event occurs.
Required permissions
messagesTagsList
onDeleted
– [Added in TB 136]
Fired when a message tag has been deleted.
Parameters for onDeleted.addListener(listener)
listener(key)
A function that will be called when this event occurs.
Parameters passed to the listener function
key
Unique tag identifier of the deleted message tag.
Required permissions
accountsRead
onUpdated
– [Added in TB 136]
Fired when one or more properties of a message tag have been updated.
Parameters for onUpdated.addListener(listener)
listener(key, changedProperties, oldProperties)
A function that will be called when this event occurs.
Parameters passed to the listener function
key
Unique tag identifier of the updated message tag.
changedProperties
The changed message tag properties.
oldProperties
The old values of the changed message tag properties.
Required permissions
messagesTagsList
Types
MessageTag
– [Added in TB 121]
MessageTagProperties
– [Added in TB 136]
TagsDetail
– [Added in TB 121]
Used for filtering messages by tag in various methods. Note that functions using this type may have a partial implementation.
object
mode
tags