title: Managing FCM device groups
body: <p>I'm trying to figure out how to manage FCM device groups from an app server by using the REST API.</p>
  
  <p>AFAIK these are the updated docs: <a href="https://firebase.google.com/docs/cloud-messaging/android/device-group#managing_device_groups" rel="noreferrer">https://firebase.google.com/docs/cloud-messaging/android/device-group#managing_device_groups</a></p>
  
  <p>Here's what I can already do:</p>
  
  <ul>
  <li>Create a new device group with some device tokens</li>
  <li>Add device tokens to an existing device group</li>
  </ul>
  
  <p>And this is what I just can't figure out how to do since there's no mention of it in the docs:</p>
  
  <ul>
  <li><p>Query whether a device group already exists, based on its <code>notification_key_name</code>.</p>
  
  <p>Workaround 1: if I try creating a group with a <code>notification_key_name</code>
  that already exists then I get an error telling me so, but that seems
  like a <em>very</em> hacky way to find out.</p>
  
  <p>Workaround 2: Store that information by myself somewhere else.</p></li>
  <li><p>Finding out which device tokens (<code>registration_id</code>) belong to a device group. </p>
  
  <p>Workaround: as before, store that information by myself somewhere else.</p></li>
  <li><p>Remove device tokens (<code>registration_id</code>) from a device group.</p>
  
  <p>Workaround: none.</p></li>
  <li><p>Remove a device group.</p>
  
  <p>Workaround: none.</p></li>
  </ul>
  
  <p>Thanks!</p>