Error 403 when sending a Google Indexing API request

When sending Google Indexing API requests, the request is considered successful if Google returned a 200 response. But very often users encounter the 403 error. This error indicates that you do not have the rights to send this request. This is a common mistake. And all possible reasons for this error are listed below.

Causes of error 403 when sending Google Indexing API requests

  1. After creating the Google Indexing API key, the Indexing API for the project was not activated.
  2. The key is not linked to the site in the Google Search Console or it has been granted the wrong rights (it must have the rights of the OWNER).
  3. If a site is added to the Search Console with a prefix, for example, https://site.com, but you're trying to send http://site.com. Exactly the same with/without www.
  4. When installing the Goolge indexer yourself, you did not correctly specify the paths in the file config.php.
  5. The server is on IPv6. Google only accepts requests from IPv4.