Skip to content

Instantly share code, notes, and snippets.

@iamtalhaasghar
Created February 25, 2024 09:30
Show Gist options
  • Save iamtalhaasghar/01d8748243273038a821f42cc9902a89 to your computer and use it in GitHub Desktop.
Save iamtalhaasghar/01d8748243273038a821f42cc9902a89 to your computer and use it in GitHub Desktop.
Send server notice msg as an admin to any user in your synapse / matrix homeserver
# Prompts by https://gist.github.com/iamtalhaasghar
# Written by Chatgpt
# 25-Feb-2024
curl -X POST \
-H "Authorization: Bearer <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"user_id": "@<target_user>:<server_domain>",
"content": {
"msgtype": "m.text",
"body": "THIS IS A SERVER NOTICE"
}
}' \
https://<server_url>/_synapse/admin/v1/send_server_notice
@iamtalhaasghar
Copy link
Author

There is an issue open to send messages to all users instead of one specific user. element-hq/synapse#5501

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment