Messaging

Push notifications

Register a device push token, then send notifications. Delivery goes through your project's own FCM/APNs credential (configured by a project admin), since push can only be delivered by Google/Apple.

Register & send
# a signed-in device registers its token
POST /messaging/targets  { "targetId":"unique()","provider":"fcm","token":"<DEVICE_TOKEN>" }

# send to a user (server key)
curl -X POST "https://base.finiteskills.com/v1/messaging/push" -H "X-Appwrite-Project: <YOUR_PROJECT_ID>" \
  -H "X-Appwrite-Key: <API_KEY>" -H "Content-Type: application/json" \
  -d '{"title":"Hi","body":"Your order shipped","userId":"USER_ID"}'

If no provider is configured, send returns 503 general_provider_unconfigured.

Transactional email & SMS

Send your own email and SMS through the project's configured mail/SMS provider (server key). Address one or more recipients directly with to, or a whole topic with topicId:

Send
# email
curl -X POST "https://base.finiteskills.com/v1/messaging/email" -H "X-Appwrite-Project: <YOUR_PROJECT_ID>" \
  -H "X-Appwrite-Key: <API_KEY>" -H "Content-Type: application/json" \
  -d '{"to":["user@example.com"],"subject":"Welcome","text":"Hi Jane","html":"<b>Hi Jane</b>"}'

# sms
curl -X POST "https://base.finiteskills.com/v1/messaging/sms" -H "X-Appwrite-Project: <YOUR_PROJECT_ID>" \
  -H "X-Appwrite-Key: <API_KEY>" -H "Content-Type: application/json" \
  -d '{"to":["+15551234567"],"body":"Your code is 123456"}'

Each send persists a message record; fetch it with GET /messaging/messages/{id} to check its status (sent, queued or failed).

Templates

Store reusable email/SMS bodies with {{variable}} placeholders, then send by templateId + a data map for substitution:

Templates
POST   /messaging/templates  { "name":"welcome","channel":"email",
                               "subject":"Welcome {{name}}","body":"Hi {{name}}!" }
GET    /messaging/templates
DELETE /messaging/templates/{templateId}

# send using it
POST /messaging/email  { "to":["user@example.com"], "templateId":"welcome",
                         "data":{"name":"Jane"} }

Topics & subscribers

Group recipients into a topic and broadcast to all of them at once — useful for newsletters or announcements:

Topics
POST /messaging/topics                      { "name":"Product updates" }
POST /messaging/topics/{topicId}/subscribers { "targetId":"..." }
GET  /messaging/topics

# then send to everyone subscribed
POST /messaging/email  { "topicId":"TOPIC_ID","subject":"News","text":"..." }

Account email

Account emails (verification, recovery) are sent by the platform when email is configured. When it is not, the relevant token/link is returned in the API response so your app can deliver it.