identities API
The identities API allows to manage the user’s identities (each account can have multiple identities).
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.
accountsIdentities
Create, modify or delete your mail account identities.
accountsRead
See your mail accounts, their identities and their folders.
Functions
create(accountId, details)
– [Added in TB 91]
Create a new identity in the specified account.
Required permissions
delete(identityId)
– [Added in TB 91]
Attempts to delete the requested identity. Default identities cannot be deleted.
Required permissions
get(identityId)
– [Added in TB 91]
Returns details of the requested identity, or null if it doesn’t exist.
Required permissions
getDefault(accountId)
– [Added in TB 91]
Returns the default identity for the requested account, or null if it is not defined.
Required permissions
list([accountId])
– [Added in TB 91]
Returns the identities of the specified account, or all identities if no account is specified. Do not expect the returned identities to be in any specific order. Use getDefault(accountId) to get the default identity of an account.
Required permissions
setDefault(accountId, identityId)
– [Added in TB 91]
Sets the default identity for the requested account.
Required permissions
update(identityId, details)
– [Added in TB 91]
Updates the details of an identity.
Required permissions
Events
onCreated
– [Added in TB 91]
Fired when a new identity has been created and added to an account. The event also fires for default identities that are created when a new account is added.
Parameters for onCreated.addListener(listener)
listener(identityId, identity)
A function that will be called when this event occurs.
Parameters passed to the listener function
identityId
identity
Required permissions
onDeleted
– [Added in TB 91]
Fired when an identity has been removed from an account.
Parameters for onDeleted.addListener(listener)
listener(identityId)
A function that will be called when this event occurs.
Required permissions
onUpdated
– [Added in TB 91]
Fired when one or more properties of an identity have been modified. The returned MailIdentity includes only the changed values.
Parameters for onUpdated.addListener(listener)
listener(identityId, changedValues)
A function that will be called when this event occurs.
Parameters passed to the listener function
identityId
changedValues
Required permissions
Types
EncryptionCapabilities
– [Added in TB 128]
MailIdentity
– [Added in TB 91]
object
accountId
The id of the MailAccount this identity belongs to. The accountId property is read-only.
composeHtml
If the identity uses HTML as the default compose format.
The user’s email address as used when messages are sent from this identity.
encryptionCapabilities
The encryption capabilities of this identity. Read only.
OpenPGP
The capabilities of this identity for the OpenPGP encryption technology.
S/MIME
The capabilities of this identity for the S/MIME encryption technology.
id
A unique identifier for this identity. The id property is read-only.
label
A user-defined label for this identity.
name
The user’s name as used when messages are sent from this identity.
organization
The organization associated with this identity.
replyTo
The reply-to email address associated with this identity.
signature
The signature of the identity.
signatureIsPlainText
If the signature should be interpreted as plain text or as HTML.