Drive API folder star status not syncing with web interface

I’m having trouble with the Google Drive API when trying to mark a folder as starred. The API shows the update worked but the star doesn’t appear in the actual Google Drive web interface.

When I update other properties like the folder name, those changes show up right away. But the starred property seems to be stuck. I’ve waited over 20 minutes thinking it might be a delay issue, but still nothing.

Here’s my setup code for creating a directory:

from googleapiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials

from config import DRIVE_API_CREDENTIALS, ROOT_DIR_ID

SCOPE_LIST = ["https://www.googleapis.com/auth/drive"]

creds = ServiceAccountCredentials.from_json_keyfile_dict(
    DRIVE_API_CREDENTIALS, SCOPE_LIST
)

drive_service = build("drive", "v3", credentials=creds, cache_discovery=False)

folder_data = {
    "name": "Test Directory",
    "mimeType": "application/vnd.google-apps.folder",
    "parents": [ROOT_DIR_ID],
}

new_folder = drive_service.files().create(body=folder_data, fields="id").execute()

Then I try to modify both the name and star status:

modification_data = {"name": "Updated Directory Name", "starred": True}

modified_result = (
    drive_service.files()
    .update(fileId=new_folder["id"], body=modification_data, fields="name, starred")
    .execute()
)

When I check the result with a GET request:

verify_result = (
    drive_service.files().get(fileId=new_folder["id"], fields="name,starred").execute()
)
print(verify_result)

The output shows: {'name': 'Updated Directory Name', 'starred': True}

But in the actual Google Drive interface, the folder shows the new name but no star icon. Has anyone else run into this problem? Is there something I’m missing in my API calls?

service accounts can’t share starred status with your personal drive - that’s your problem. you’ll need user oauth instead of service account auth to see stars in the web ui. the api response looks right, but it’s only starred for the service account, not the google account you’re viewing in your browser.

This happens because you’re using a service account for authentication. Service accounts operate in isolation; when you star a folder via the API, it only updates the starred status for that service account, not your personal Google account visible in the web interface. Each Google account maintains its own starred items separately. To have the stars show up in the web interface, you should utilize OAuth2 with your actual user account, allowing access to user-specific features like starred status.

Yeah, miar’s right - service accounts are stuck in their own world.

Honestly, Google Drive API quirks like this are why I just automate everything through platforms that handle auth headaches for you.

I had the same issue syncing folder states between Google accounts. Instead of fighting OAuth flows and service account limits, I built it in Latenode. They handle the auth complexity so you can focus on actual logic.

You can set up workflows using proper user OAuth for starring while still using service accounts for other tasks. No more guessing which auth method works for each endpoint.

Plus you get error handling and retry logic when the API breaks, which happens way more than Google admits.

Check it out: https://latenode.com

Starred folders work differently than other metadata - they’re personal bookmarks, not file properties. When your service account updates the folder name, everyone sees that change because it modifies the actual file. But starring? That’s tied to individual user accounts. Your service account starred the folder from its own perspective, but your personal Google account doesn’t know about it. You’ll need to set up OAuth flow so the actual user can grant permission to modify their Drive preferences. This means handling the OAuth consent screen and using user credentials instead of service account credentials for anything involving starred status.