title: FCM HTTP V1 API returns 404 for unregistered token
body: <p>FCM HTTP v1 API supposed to return error code "UNREGISTERED" when device is unregistered (app uninstalled). However API returns 404 "Requested entity was not found".</p>
  
  <p>Have anyone experienced this? Is this the expected one? There is no mention about this anywhere in the documentation.</p>
  
  <p>Is it safe to assume device is unregistered when 404 error with the message "Requested entity was not found" received?</p>
  
  <p>Following is the full body of the error received.</p>
  
  <pre><code>{
    "error": {
      "code": 404,
      "message": "Requested entity was not found.",
      "errors": [
        {
          "message": "Requested entity was not found.",
          "domain": "global",
          "reason": "notFound"
        }
      ],
      "status": "NOT_FOUND"
    }
  }
  </code></pre>
  
  <p>Exception:</p>
  
  <pre><code>Caused by: com.google.firebase.messaging.FirebaseMessagingException: Requested entity was not found.
      at com.google.firebase.messaging.FirebaseMessaging.handleSendHttpError(FirebaseMessaging.java:266) ~[firebase-admin-5.9.0.jar:?]
  </code></pre>
  
  <p>For reference API documentation:</p>
  
  <p><a href="https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages" rel="noreferrer">https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages</a>
  <a href="https://firebase.google.com/docs/reference/fcm/rest/v1/ErrorCode" rel="noreferrer">https://firebase.google.com/docs/reference/fcm/rest/v1/ErrorCode</a></p>