Google Chat Direct Messages to Users using spaceIDs

Describe the problem/error/question

I have a list of users stored in supabase with correct spaceID’s (all checked and verified) and I want to use them to send out direct messages on a daily basis using Google Chat
I have a chatbot inside of our Google Chat Workspace that has been installed Widely for everyone.
I get the error “Forbidden - perhaps check your credentials? This Chat app is not a member of this space.”
Keep in mind I have tried with different types of credentials (service and oath2 but none seems to be working.
I even went ahead to set the spaceID alone to see if it works but nothing,
I would really appreciate any help to achieve this, keep in mind it has to be Direct Messages between the bot and users.

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version:latest
  • Database (default: SQLite):supabase
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • **Operating system: Windows
    **
1 Like

Hi @Samuel_Nganga Welcome!
This is expected as this is not an n8n side error, for now make sure every user has at least sent a message to bot 1:1 because only after this the BOT would see the DMs and so the SpaceID would be usable. also verify that spaceID and make sure it is correct so check the database, for now use service type google credentials.

The “not a member of this space” error means the bot doesn’t have an active DM space with those users yet, even if it’s installed org-wide that doesn’t automatically create DM spaces. Each user needs to have messaged the bot at least once first to create the space, or you need to use a service account with domain-wide delegation and the spaces.setup API to create DM spaces programmatically before sending.

Thank you for the response :slight_smile:
The bot is already in place, and everyone has already interacted with it as we use it like an assistant for our company already.
On top of that everyone has already authorized it (calendar, Gmail, drive)
We also have a google token and it gets refreshed every time.
SpaceID is correct and verified a couple of times
I have tried with both credentials type