title: Recover Cloud functions default service account with the undelete POST call
body: <p>I have used Google Cloud Functions for quite a long time, with no real authentication problem for now.
  Today I meet this error while deploying a new function</p>
  
  <pre><code>ERROR: (gcloud.functions.deploy) ResponseError: status=[400], code=[Bad Request], message=[Default service account 'PROJECT-ID@appspot.gserviceaccount.com' doesn't exist. Please recreate this account (for example by disabling and enabling the Cloud Functions API), or specify a different account.]
  </code></pre>
  
  <p>I tried several things :</p>
  
  <ul>
  <li>disable/enable GCF API : no service account recovered</li>
  <li><code>gcloud beta app repair</code> <a href="https://cloud.google.com/sdk/gcloud/reference/beta/app/repair" rel="nofollow noreferrer">reference here</a>
  No default service account recovered</li>
  <li>the <a href="https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B&quot;name&quot;%3A&quot;projects%2F-%2FserviceAccounts%2Funique_id&quot;%2C&quot;resource&quot;%3A%7B%7D%7D" rel="nofollow noreferrer">undelete API POST call</a></li>
  </ul>
  
  <p>If I understand well the current GCP features, using the last option is my best solution, but somehow I keep getting a 400 error</p>
  
  <p><img src="https://i.imgur.com/QbHv1oO.png" alt=""></p>
  
  <p>I found my unique-id in my log activity at the creation of the default service account</p>
  
  <p><img src="https://i.imgur.com/ZGuQKKd.png" alt=""></p>
  
  <p>I really can't see where is the problem in the undelete API call and would be really thankful if you could help with it</p>