
Hello Appwrite Team,
I'm experiencing a "SERVER ERROR" whenever I attempt to send push notifications using the Messaging API. The function fails without clear details on what might be wrong.
Here’s the exact code I’m using:
ID.unique(), // messageId
'Don\'t Miss Your Prayer Partner!', // title
'You have 24 hours to open the app or you will be set to inactive.', // body
[], // topics (optional)
[user.$id], // users (optional)
[], // targets (optional)
{
fromName: 'Nosakhare',
messageType: 'TEXT',
message: 'You have 24 hours to open the app or you will be set to inactive',
fromUserId: '0'
}, // data (optional)
'open_app', // action (optional)
null, // image (optional)
'default_icon', // icon (optional)
'default', // sound (optional)
'#6E0FAD', // color (optional)
'inactivity_alert', // tag (optional)
1, // badge (optional)
false, // draft (optional)
null // scheduledAt (optional)
);```
Everything seems correct based on the documentation, yet the API consistently returns a server error. Could you please check if this is an issue on Appwrite’s end or let me know if any modifications are required?

i added the below code for more info about the issues
log(`Detailed error for user ${user.$id}: ${JSON.stringify(error)}`);
log(`Error stack: ${error.stack}`);
log(`Failed to process user ${user.$id}: ${error.message}`);```
**so, here is the output of the log**
Failed to process user 2349034286339: Server Error Detailed error for user 2349034286339: {"name":"AppwriteException","code":500,"type":"general_unknown","response":{"message":"Server Error","code":500,"type":"general_unknown","version":"1.6.1"}} Error stack: AppwriteException: Server Error at _Client.call (file:///usr/local/server/src/function/node_modules/node-appwrite/dist/client.mjs:274:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Messaging.createPush (file:///usr/local/server/src/function/node_modules/node-appwrite/dist/services/messaging.mjs:276:12) at async processBatch (file:///usr/local/server/src/function/src/main.js:101:28) at async processNextChunk (file:///usr/local/server/src/function/src/main.js:40:7) at async Module.default (file:///usr/local/server/src/function/src/main.js:53:20) at async execute (/usr/local/server/src/server.js:208:16) at async action (/usr/local/server/src/server.js:225:7) at async /usr/local/server/src/server.js:14:5```

if you are having issues like this, its a result of the structure of the Messaging api, below is what works for me
try {
await messaging.createPush(
ID.unique(),
'Don\'t Miss Your Prayer Partner!',
'You have 24 hours to open the app or you will be set to inactive.',
[],
[user.$id],
[],
{
fromName: 'Nosakhare',
messageType: 'TEXT',
message: 'You have 24 hours to open the app or you will be set to inactive',
fromUserId: '0'
},
'open_app'
);
} catch (error) {
log(`Detailed error for user ${user.$id}: ${JSON.stringify(error)}`);
// log(`Error stack: ${error.stack}`);
}

[SOLVED] Messaging API Failing with "SERVER ERROR"
Recommended threads
- CSV Import Shows Success but Data Not Ap...
I tried importing a CSV file into my PRODUCTS collection. The dashboard shows the message “Import to PRODUCTS completed successfully,” but no data appears in th...
- Console create row ui not passing ID.uni...
I'm getting an error saying the id is already used but it should be created with ID.unique() it doesn't seem to be reading the row ID field at all. I can't get ...
- [FEATURE] Better usage analytics for app...
Recently, i've gotten **73** emails from appwrite regarding excesive GBHours usage. I've almost hit the limit of 1000 and it is really hard to track down which ...
