A 403 error on an Indexing API usually means permission denied or authentication issue.
For Google Indexing API, common reasons are:
Common Causes of 403 Error
- Service Account not added
- Add your Google Cloud service account email as Owner in:
- Google Search Console
- Use the exact service account email ending with:
xxxxx@xxxxx.iam.gserviceaccount.com
- Add your Google Cloud service account email as Owner in:
- Indexing API not enabled
- In Google Cloud Console:
- APIs & Services → Library
- Enable:
- Indexing API
- In Google Cloud Console:
- Wrong API Scope
Use this scope:https://www.googleapis.com/auth/indexing - Website not verified
- Your site must be verified in:
- Using Indexing API for unsupported pages
Google officially allows Indexing API mainly for:- Job Posting pages
- Live Stream pages
Normal blog/product pages may return errors or limited success.
- JSON Key issue
- Make sure the downloaded JSON credentials file is correct and active.
- Wrong endpoint
Correct endpoint:https://indexing.googleapis.com/v3/urlNotifications:publish
Example PHP Request
$client = new Google_Client();
$client->setAuthConfig('service-account.json');
$client->addScope('https://www.googleapis.com/auth/indexing');
$httpClient = $client->authorize();
$response = $httpClient->post(
'https://indexing.googleapis.com/v3/urlNotifications:publish',
[
'json' => [
'url' => 'https://example.com/page-url',
'type' => 'URL_UPDATED'
]
]
);
echo $response->getBody();
