Appwrite Messaging helps you communicate with your users through push notifications, emails, and SMS text messages. Sending personalized communication for marketing, updates, and realtime alerts can increase user engagement and retention. You can also use Appwrite Messaging to implement security checks and custom authentication flows.
You can find guides and examples on using the Messaging API in the Appwrite Messaging product pages.
https://<REGION>.cloud.appwrite.io/v1
Create APNS provider
Create a new Apple Push Notification service provider.
Request
providerId string requiredProvider ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.name string requiredProvider name.
authKey string APNS authentication key.
authKeyId string APNS authentication key ID.
teamId string APNS team ID.
bundleId string APNS bundle ID.
sandbox boolean Use APNS sandbox environment.
enabled boolean Set as enabled.
Response
201 application/json
POST /messaging/providers/apns
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_apns_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>',
auth_key = '<AUTH_KEY>', # optional
auth_key_id = '<AUTH_KEY_ID>', # optional
team_id = '<TEAM_ID>', # optional
bundle_id = '<BUNDLE_ID>', # optional
sandbox = False, # optional
enabled = False # optional
)
Create FCM provider
Create a new Firebase Cloud Messaging provider.
Request
providerId string requiredProvider ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.name string requiredProvider name.
serviceAccountJSON object FCM service account JSON.
enabled boolean Set as enabled.
Response
201 application/json
POST /messaging/providers/fcm
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_fcm_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>',
service_account_json = {}, # optional
enabled = False # optional
)
Create Mailgun provider
Create a new Mailgun provider.
Request
providerId string requiredProvider ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.name string requiredProvider name.
apiKey string Mailgun API Key.
domain string Mailgun Domain.
isEuRegion boolean Set as EU region.
fromName string Sender Name.
fromEmail string Sender email address.
replyToName string Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.
replyToEmail string Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.
enabled boolean Set as enabled.
Response
201 application/json
POST /messaging/providers/mailgun
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_mailgun_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>',
api_key = '<API_KEY>', # optional
domain = '<DOMAIN>', # optional
is_eu_region = False, # optional
from_name = '<FROM_NAME>', # optional
from_email = 'email@example.com', # optional
reply_to_name = '<REPLY_TO_NAME>', # optional
reply_to_email = 'email@example.com', # optional
enabled = False # optional
)
Create Msg91 provider
Create a new MSG91 provider.
Request
providerId string requiredProvider ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.name string requiredProvider name.
templateId string Msg91 template ID
senderId string Msg91 sender ID.
authKey string Msg91 auth key.
enabled boolean Set as enabled.
Response
201 application/json
POST /messaging/providers/msg91
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_msg91_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>',
template_id = '<TEMPLATE_ID>', # optional
sender_id = '<SENDER_ID>', # optional
auth_key = '<AUTH_KEY>', # optional
enabled = False # optional
)
Create Sendgrid provider
Create a new Sendgrid provider.
Request
providerId string requiredProvider ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.name string requiredProvider name.
apiKey string Sendgrid API key.
fromName string Sender Name.
fromEmail string Sender email address.
replyToName string Name set in the reply to field for the mail. Default value is sender name.
replyToEmail string Email set in the reply to field for the mail. Default value is sender email.
enabled boolean Set as enabled.
Response
201 application/json
POST /messaging/providers/sendgrid
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_sendgrid_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>',
api_key = '<API_KEY>', # optional
from_name = '<FROM_NAME>', # optional
from_email = 'email@example.com', # optional
reply_to_name = '<REPLY_TO_NAME>', # optional
reply_to_email = 'email@example.com', # optional
enabled = False # optional
)
Create SMTP provider
Create a new SMTP provider.
Request
providerId string requiredProvider ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.name string requiredProvider name.
host string requiredSMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as
smtp1.example.com:25;smtp2.example.com
. You can also specify encryption type, for example:tls://smtp1.example.com:587;ssl://smtp2.example.com:465"
. Hosts will be tried in order.port integer The default SMTP server port.
username string Authentication username.
password string Authentication password.
encryption string Encryption type. Can be omitted, 'ssl', or 'tls'
autoTLS boolean Enable SMTP AutoTLS feature.
mailer string The value to use for the X-Mailer header.
fromName string Sender Name.
fromEmail string Sender email address.
replyToName string Name set in the reply to field for the mail. Default value is sender name.
replyToEmail string Email set in the reply to field for the mail. Default value is sender email.
enabled boolean Set as enabled.
Response
201 application/json
POST /messaging/providers/smtp
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_smtp_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>',
host = '<HOST>',
port = 1, # optional
username = '<USERNAME>', # optional
password = '<PASSWORD>', # optional
encryption = SmtpEncryption.NONE, # optional
auto_tls = False, # optional
mailer = '<MAILER>', # optional
from_name = '<FROM_NAME>', # optional
from_email = 'email@example.com', # optional
reply_to_name = '<REPLY_TO_NAME>', # optional
reply_to_email = 'email@example.com', # optional
enabled = False # optional
)
Create Telesign provider
Create a new Telesign provider.
Request
providerId string requiredProvider ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.name string requiredProvider name.
from string Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
customerId string Telesign customer ID.
apiKey string Telesign API key.
enabled boolean Set as enabled.
Response
201 application/json
POST /messaging/providers/telesign
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_telesign_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>',
from = '+12065550100', # optional
customer_id = '<CUSTOMER_ID>', # optional
api_key = '<API_KEY>', # optional
enabled = False # optional
)
Create Textmagic provider
Create a new Textmagic provider.
Request
providerId string requiredProvider ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.name string requiredProvider name.
from string Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
username string Textmagic username.
apiKey string Textmagic apiKey.
enabled boolean Set as enabled.
Response
201 application/json
POST /messaging/providers/textmagic
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_textmagic_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>',
from = '+12065550100', # optional
username = '<USERNAME>', # optional
api_key = '<API_KEY>', # optional
enabled = False # optional
)
Create Twilio provider
Create a new Twilio provider.
Request
providerId string requiredProvider ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.name string requiredProvider name.
from string Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
accountSid string Twilio account secret ID.
authToken string Twilio authentication token.
enabled boolean Set as enabled.
Response
201 application/json
POST /messaging/providers/twilio
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_twilio_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>',
from = '+12065550100', # optional
account_sid = '<ACCOUNT_SID>', # optional
auth_token = '<AUTH_TOKEN>', # optional
enabled = False # optional
)
Create Vonage provider
Create a new Vonage provider.
Request
providerId string requiredProvider ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.name string requiredProvider name.
from string Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
apiKey string Vonage API key.
apiSecret string Vonage API secret.
enabled boolean Set as enabled.
Response
201 application/json
POST /messaging/providers/vonage
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_vonage_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>',
from = '+12065550100', # optional
api_key = '<API_KEY>', # optional
api_secret = '<API_SECRET>', # optional
enabled = False # optional
)
Get provider
Get a provider by its unique ID.
Request
providerId string requiredProvider ID.
Response
200 application/json
GET /messaging/providers/{providerId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.get_provider(
provider_id = '<PROVIDER_ID>'
)
List provider logs
Get the provider activity logs listed by its unique ID.
Request
providerId string requiredProvider ID.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Only supported methods are limit and offset
Response
200 application/json
GET /messaging/providers/{providerId}/logs
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.list_provider_logs(
provider_id = '<PROVIDER_ID>',
queries = [] # optional
)
List providers
Get a list of all providers from the current Appwrite project.
Request
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled
search string Search term to filter your list results. Max length: 256 chars.
Response
200 application/json
GET /messaging/providers
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.list_providers(
queries = [], # optional
search = '<SEARCH>' # optional
)
Update APNS provider
Update a Apple Push Notification service provider by its unique ID.
Request
providerId string requiredProvider ID.
name string Provider name.
enabled boolean Set as enabled.
authKey string APNS authentication key.
authKeyId string APNS authentication key ID.
teamId string APNS team ID.
bundleId string APNS bundle ID.
sandbox boolean Use APNS sandbox environment.
Response
200 application/json
PATCH /messaging/providers/apns/{providerId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_apns_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>', # optional
enabled = False, # optional
auth_key = '<AUTH_KEY>', # optional
auth_key_id = '<AUTH_KEY_ID>', # optional
team_id = '<TEAM_ID>', # optional
bundle_id = '<BUNDLE_ID>', # optional
sandbox = False # optional
)
Update FCM provider
Update a Firebase Cloud Messaging provider by its unique ID.
Request
providerId string requiredProvider ID.
name string Provider name.
enabled boolean Set as enabled.
serviceAccountJSON object FCM service account JSON.
Response
200 application/json
PATCH /messaging/providers/fcm/{providerId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_fcm_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>', # optional
enabled = False, # optional
service_account_json = {} # optional
)
Update Mailgun provider
Update a Mailgun provider by its unique ID.
Request
providerId string requiredProvider ID.
name string Provider name.
apiKey string Mailgun API Key.
domain string Mailgun Domain.
isEuRegion boolean Set as EU region.
enabled boolean Set as enabled.
fromName string Sender Name.
fromEmail string Sender email address.
replyToName string Name set in the reply to field for the mail. Default value is sender name.
replyToEmail string Email set in the reply to field for the mail. Default value is sender email.
Response
200 application/json
PATCH /messaging/providers/mailgun/{providerId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_mailgun_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>', # optional
api_key = '<API_KEY>', # optional
domain = '<DOMAIN>', # optional
is_eu_region = False, # optional
enabled = False, # optional
from_name = '<FROM_NAME>', # optional
from_email = 'email@example.com', # optional
reply_to_name = '<REPLY_TO_NAME>', # optional
reply_to_email = '<REPLY_TO_EMAIL>' # optional
)
Update Msg91 provider
Update a MSG91 provider by its unique ID.
Request
providerId string requiredProvider ID.
name string Provider name.
enabled boolean Set as enabled.
templateId string Msg91 template ID.
senderId string Msg91 sender ID.
authKey string Msg91 auth key.
Response
200 application/json
PATCH /messaging/providers/msg91/{providerId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_msg91_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>', # optional
enabled = False, # optional
template_id = '<TEMPLATE_ID>', # optional
sender_id = '<SENDER_ID>', # optional
auth_key = '<AUTH_KEY>' # optional
)
Update Sendgrid provider
Update a Sendgrid provider by its unique ID.
Request
providerId string requiredProvider ID.
name string Provider name.
enabled boolean Set as enabled.
apiKey string Sendgrid API key.
fromName string Sender Name.
fromEmail string Sender email address.
replyToName string Name set in the Reply To field for the mail. Default value is Sender Name.
replyToEmail string Email set in the Reply To field for the mail. Default value is Sender Email.
Response
200 application/json
PATCH /messaging/providers/sendgrid/{providerId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_sendgrid_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>', # optional
enabled = False, # optional
api_key = '<API_KEY>', # optional
from_name = '<FROM_NAME>', # optional
from_email = 'email@example.com', # optional
reply_to_name = '<REPLY_TO_NAME>', # optional
reply_to_email = '<REPLY_TO_EMAIL>' # optional
)
Update SMTP provider
Update a SMTP provider by its unique ID.
Request
providerId string requiredProvider ID.
name string Provider name.
host string SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as
smtp1.example.com:25;smtp2.example.com
. You can also specify encryption type, for example:tls://smtp1.example.com:587;ssl://smtp2.example.com:465"
. Hosts will be tried in order.port integer SMTP port.
username string Authentication username.
password string Authentication password.
encryption string Encryption type. Can be 'ssl' or 'tls'
autoTLS boolean Enable SMTP AutoTLS feature.
mailer string The value to use for the X-Mailer header.
fromName string Sender Name.
fromEmail string Sender email address.
replyToName string Name set in the Reply To field for the mail. Default value is Sender Name.
replyToEmail string Email set in the Reply To field for the mail. Default value is Sender Email.
enabled boolean Set as enabled.
Response
200 application/json
PATCH /messaging/providers/smtp/{providerId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_smtp_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>', # optional
host = '<HOST>', # optional
port = 1, # optional
username = '<USERNAME>', # optional
password = '<PASSWORD>', # optional
encryption = SmtpEncryption.NONE, # optional
auto_tls = False, # optional
mailer = '<MAILER>', # optional
from_name = '<FROM_NAME>', # optional
from_email = 'email@example.com', # optional
reply_to_name = '<REPLY_TO_NAME>', # optional
reply_to_email = '<REPLY_TO_EMAIL>', # optional
enabled = False # optional
)
Update Telesign provider
Update a Telesign provider by its unique ID.
Request
providerId string requiredProvider ID.
name string Provider name.
enabled boolean Set as enabled.
customerId string Telesign customer ID.
apiKey string Telesign API key.
from string Sender number.
Response
200 application/json
PATCH /messaging/providers/telesign/{providerId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_telesign_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>', # optional
enabled = False, # optional
customer_id = '<CUSTOMER_ID>', # optional
api_key = '<API_KEY>', # optional
from = '<FROM>' # optional
)
Update Textmagic provider
Update a Textmagic provider by its unique ID.
Request
providerId string requiredProvider ID.
name string Provider name.
enabled boolean Set as enabled.
username string Textmagic username.
apiKey string Textmagic apiKey.
from string Sender number.
Response
200 application/json
PATCH /messaging/providers/textmagic/{providerId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_textmagic_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>', # optional
enabled = False, # optional
username = '<USERNAME>', # optional
api_key = '<API_KEY>', # optional
from = '<FROM>' # optional
)
Update Twilio provider
Update a Twilio provider by its unique ID.
Request
providerId string requiredProvider ID.
name string Provider name.
enabled boolean Set as enabled.
accountSid string Twilio account secret ID.
authToken string Twilio authentication token.
from string Sender number.
Response
200 application/json
PATCH /messaging/providers/twilio/{providerId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_twilio_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>', # optional
enabled = False, # optional
account_sid = '<ACCOUNT_SID>', # optional
auth_token = '<AUTH_TOKEN>', # optional
from = '<FROM>' # optional
)
Update Vonage provider
Update a Vonage provider by its unique ID.
Request
providerId string requiredProvider ID.
name string Provider name.
enabled boolean Set as enabled.
apiKey string Vonage API key.
apiSecret string Vonage API secret.
from string Sender number.
Response
200 application/json
PATCH /messaging/providers/vonage/{providerId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_vonage_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>', # optional
enabled = False, # optional
api_key = '<API_KEY>', # optional
api_secret = '<API_SECRET>', # optional
from = '<FROM>' # optional
)
Delete provider
Delete a provider by its unique ID.
Request
providerId string requiredProvider ID.
Response
204 application/json
DELETE /messaging/providers/{providerId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.delete_provider(
provider_id = '<PROVIDER_ID>'
)
Create topic
Create a new topic.
Request
topicId string requiredTopic ID. Choose a custom Topic ID or a new Topic ID.
name string requiredTopic Name.
subscribe array An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. learn more about roles. Maximum of 100 roles are allowed, each 64 characters long.
Response
201 application/json
POST /messaging/topics
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_topic(
topic_id = '<TOPIC_ID>',
name = '<NAME>',
subscribe = ["any"] # optional
)
Get topic
Get a topic by its unique ID.
Request
topicId string requiredTopic ID.
Response
200 application/json
GET /messaging/topics/{topicId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.get_topic(
topic_id = '<TOPIC_ID>'
)
List topic logs
Get the topic activity logs listed by its unique ID.
Request
topicId string requiredTopic ID.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Only supported methods are limit and offset
Response
200 application/json
GET /messaging/topics/{topicId}/logs
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.list_topic_logs(
topic_id = '<TOPIC_ID>',
queries = [] # optional
)
List topics
Get a list of all topics from the current Appwrite project.
Request
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal
search string Search term to filter your list results. Max length: 256 chars.
Response
200 application/json
GET /messaging/topics
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.list_topics(
queries = [], # optional
search = '<SEARCH>' # optional
)
Update topic
Update a topic by its unique ID.
Request
topicId string requiredTopic ID.
name string Topic Name.
subscribe array An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. learn more about roles. Maximum of 100 roles are allowed, each 64 characters long.
Response
200 application/json
PATCH /messaging/topics/{topicId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_topic(
topic_id = '<TOPIC_ID>',
name = '<NAME>', # optional
subscribe = ["any"] # optional
)
Delete topic
Delete a topic by its unique ID.
Request
topicId string requiredTopic ID.
Response
204 application/json
DELETE /messaging/topics/{topicId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.delete_topic(
topic_id = '<TOPIC_ID>'
)
Create subscriber
Create a new subscriber.
Request
topicId string requiredTopic ID. The topic ID to subscribe to.
subscriberId string requiredSubscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
targetId string requiredTarget ID. The target ID to link to the specified Topic ID.
Response
201 application/json
POST /messaging/topics/{topicId}/subscribers
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token
messaging = Messaging(client)
result = messaging.create_subscriber(
topic_id = '<TOPIC_ID>',
subscriber_id = '<SUBSCRIBER_ID>',
target_id = '<TARGET_ID>'
)
Get subscriber
Get a subscriber by its unique ID.
Request
topicId string requiredTopic ID. The topic ID subscribed to.
subscriberId string requiredSubscriber ID.
Response
200 application/json
GET /messaging/topics/{topicId}/subscribers/{subscriberId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.get_subscriber(
topic_id = '<TOPIC_ID>',
subscriber_id = '<SUBSCRIBER_ID>'
)
List subscriber logs
Get the subscriber activity logs listed by its unique ID.
Request
subscriberId string requiredSubscriber ID.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Only supported methods are limit and offset
Response
200 application/json
GET /messaging/subscribers/{subscriberId}/logs
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.list_subscriber_logs(
subscriber_id = '<SUBSCRIBER_ID>',
queries = [] # optional
)
List subscribers
Get a list of all subscribers from the current Appwrite project.
Request
topicId string requiredTopic ID. The topic ID subscribed to.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled
search string Search term to filter your list results. Max length: 256 chars.
Response
200 application/json
GET /messaging/topics/{topicId}/subscribers
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.list_subscribers(
topic_id = '<TOPIC_ID>',
queries = [], # optional
search = '<SEARCH>' # optional
)
Delete subscriber
Delete a subscriber by its unique ID.
Request
topicId string requiredTopic ID. The topic ID subscribed to.
subscriberId string requiredSubscriber ID.
Response
204 application/json
DELETE /messaging/topics/{topicId}/subscribers/{subscriberId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token
messaging = Messaging(client)
result = messaging.delete_subscriber(
topic_id = '<TOPIC_ID>',
subscriber_id = '<SUBSCRIBER_ID>'
)
Create email
Create a new email message.
Request
messageId string requiredMessage ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.subject string requiredEmail Subject.
content string requiredEmail Content.
topics array List of Topic IDs.
users array List of User IDs.
targets array List of Targets IDs.
cc array Array of target IDs to be added as CC.
bcc array Array of target IDs to be added as BCC.
attachments array Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
draft boolean Is message a draft
html boolean Is content of type HTML
scheduledAt string Scheduled delivery time for message in ISO 8601 format. DateTime value must be in future.
Response
201 application/json
POST /messaging/messages/email
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_email(
message_id = '<MESSAGE_ID>',
subject = '<SUBJECT>',
content = '<CONTENT>',
topics = [], # optional
users = [], # optional
targets = [], # optional
cc = [], # optional
bcc = [], # optional
attachments = [], # optional
draft = False, # optional
html = False, # optional
scheduled_at = '' # optional
)
Create push notification
Create a new push notification.
Request
messageId string requiredMessage ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.title string Title for push notification.
body string Body for push notification.
topics array List of Topic IDs.
users array List of User IDs.
targets array List of Targets IDs.
data object Additional key-value pair data for push notification.
action string Action for push notification.
image string Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
icon string Icon for push notification. Available only for Android and Web Platform.
sound string Sound for push notification. Available only for Android and iOS Platform.
color string Color for push notification. Available only for Android Platform.
tag string Tag for push notification. Available only for Android Platform.
badge integer Badge for push notification. Available only for iOS Platform.
draft boolean Is message a draft
scheduledAt string Scheduled delivery time for message in ISO 8601 format. DateTime value must be in future.
contentAvailable boolean If set to true, the notification will be delivered in the background. Available only for iOS Platform.
critical boolean If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
priority string Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.
Response
201 application/json
POST /messaging/messages/push
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_push(
message_id = '<MESSAGE_ID>',
title = '<TITLE>', # optional
body = '<BODY>', # optional
topics = [], # optional
users = [], # optional
targets = [], # optional
data = {}, # optional
action = '<ACTION>', # optional
image = '[ID1:ID2]', # optional
icon = '<ICON>', # optional
sound = '<SOUND>', # optional
color = '<COLOR>', # optional
tag = '<TAG>', # optional
badge = None, # optional
draft = False, # optional
scheduled_at = '', # optional
content_available = False, # optional
critical = False, # optional
priority = MessagePriority.NORMAL # optional
)
Create SMS
Create a new SMS message.
Request
messageId string requiredMessage ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.content string requiredSMS Content.
topics array List of Topic IDs.
users array List of User IDs.
targets array List of Targets IDs.
draft boolean Is message a draft
scheduledAt string Scheduled delivery time for message in ISO 8601 format. DateTime value must be in future.
Response
201 application/json
POST /messaging/messages/sms
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.create_sms(
message_id = '<MESSAGE_ID>',
content = '<CONTENT>',
topics = [], # optional
users = [], # optional
targets = [], # optional
draft = False, # optional
scheduled_at = '' # optional
)
Get message
Get a message by its unique ID.
Request
messageId string requiredMessage ID.
Response
200 application/json
GET /messaging/messages/{messageId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.get_message(
message_id = '<MESSAGE_ID>'
)
List message targets
Get a list of the targets associated with a message.
Request
messageId string requiredMessage ID.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType
Response
200 application/json
GET /messaging/messages/{messageId}/targets
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.list_targets(
message_id = '<MESSAGE_ID>',
queries = [] # optional
)
List messages
Get a list of all messages from the current Appwrite project.
Request
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType
search string Search term to filter your list results. Max length: 256 chars.
Response
200 application/json
GET /messaging/messages
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.list_messages(
queries = [], # optional
search = '<SEARCH>' # optional
)
Update email
Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
Request
messageId string requiredMessage ID.
topics array List of Topic IDs.
users array List of User IDs.
targets array List of Targets IDs.
subject string Email Subject.
content string Email Content.
draft boolean Is message a draft
html boolean Is content of type HTML
cc array Array of target IDs to be added as CC.
bcc array Array of target IDs to be added as BCC.
scheduledAt string Scheduled delivery time for message in ISO 8601 format. DateTime value must be in future.
attachments array Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
Response
200 application/json
PATCH /messaging/messages/email/{messageId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_email(
message_id = '<MESSAGE_ID>',
topics = [], # optional
users = [], # optional
targets = [], # optional
subject = '<SUBJECT>', # optional
content = '<CONTENT>', # optional
draft = False, # optional
html = False, # optional
cc = [], # optional
bcc = [], # optional
scheduled_at = '', # optional
attachments = [] # optional
)
Update push notification
Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
Request
messageId string requiredMessage ID.
topics array List of Topic IDs.
users array List of User IDs.
targets array List of Targets IDs.
title string Title for push notification.
body string Body for push notification.
data object Additional Data for push notification.
action string Action for push notification.
image string Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
icon string Icon for push notification. Available only for Android and Web platforms.
sound string Sound for push notification. Available only for Android and iOS platforms.
color string Color for push notification. Available only for Android platforms.
tag string Tag for push notification. Available only for Android platforms.
badge integer Badge for push notification. Available only for iOS platforms.
draft boolean Is message a draft
scheduledAt string Scheduled delivery time for message in ISO 8601 format. DateTime value must be in future.
contentAvailable boolean If set to true, the notification will be delivered in the background. Available only for iOS Platform.
critical boolean If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
priority string Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.
Response
200 application/json
PATCH /messaging/messages/push/{messageId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_push(
message_id = '<MESSAGE_ID>',
topics = [], # optional
users = [], # optional
targets = [], # optional
title = '<TITLE>', # optional
body = '<BODY>', # optional
data = {}, # optional
action = '<ACTION>', # optional
image = '[ID1:ID2]', # optional
icon = '<ICON>', # optional
sound = '<SOUND>', # optional
color = '<COLOR>', # optional
tag = '<TAG>', # optional
badge = None, # optional
draft = False, # optional
scheduled_at = '', # optional
content_available = False, # optional
critical = False, # optional
priority = MessagePriority.NORMAL # optional
)
Update SMS
Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
Request
messageId string requiredMessage ID.
topics array List of Topic IDs.
users array List of User IDs.
targets array List of Targets IDs.
content string Email Content.
draft boolean Is message a draft
scheduledAt string Scheduled delivery time for message in ISO 8601 format. DateTime value must be in future.
Response
200 application/json
PATCH /messaging/messages/sms/{messageId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.update_sms(
message_id = '<MESSAGE_ID>',
topics = [], # optional
users = [], # optional
targets = [], # optional
content = '<CONTENT>', # optional
draft = False, # optional
scheduled_at = '' # optional
)
Delete message
Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.
Request
messageId string requiredMessage ID.
Response
204 application/json
DELETE /messaging/messages/{messageId}
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.delete(
message_id = '<MESSAGE_ID>'
)
List message logs
Get the message activity logs listed by its unique ID.
Request
messageId string requiredMessage ID.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Only supported methods are limit and offset
Response
200 application/json
GET /messaging/messages/{messageId}/logs
from appwrite.client import Client
from appwrite.services.messaging import Messaging
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result = messaging.list_message_logs(
message_id = '<MESSAGE_ID>',
queries = [] # optional
)