Howto get ID on newly created content through Drupal 8 REST POST
Looking at the response code for POST requests, we can see that there's no body but a header set to the full URI of the node. You can save that URI or explode it/parse it to get just the nid.

  // 201 Created responses have an empty body.
  return new ResourceResponse(NULL, 201, array('Location' =&gt; $entity-&gt;url('canonical', ['absolute' =&gt; TRUE])));