Drive API folder starring not showing up in web interface

I’m having trouble with the Google Drive API when trying to mark a folder as starred. The API call seems to work fine and returns the correct values when I check, 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 immediately. But the starred property just won’t reflect in the UI even though the API says it worked.

Here’s how I’m creating the directory first:

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

from config import DRIVE_API_CREDENTIALS, ROOT_DIRECTORY_ID

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

creds = ServiceAccountCredentials.from_json_keyfile_dict(
    DRIVE_API_CREDENTIALS, SCOPES
)

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

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

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

Then I try to update both the name and starred status:

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

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

When I verify the changes:

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

This outputs: {'name': 'Updated Directory Name', 'starred': True}

But when I look in Google Drive, the folder name is changed but there’s no star icon visible. Is this a known issue or am I missing something in my implementation?

Yeah, this is totally normal with service account auth. Service accounts live in their own Drive bubble - when you star something through the API, it only stars it for the service account, not your personal Drive. I ran into this same thing on an enterprise project. The folder shows up in your Drive because service accounts can share files with you, but stuff like starred status stays with whoever did the action. Your verification proves the API worked fine - it’s just working in the service account’s space, not yours. Your personal Google account has no clue the starring happened since it was done by a completely different user. Fix: Switch to OAuth2 user authentication instead of service account credentials. This lets the API act as your actual Google account, so starred folders will show up in the web interface. Downside is you’ll need to handle OAuth flows and token management, but that’s the price for user-visible changes.

The starred property won’t show up because service accounts have their own Drive space - completely separate from your personal account. When you star a folder through the service account, it’s only starred in that account’s view, not yours. Check the folder properties through the API vs. what you see in the web interface - they’re two totally different user contexts. Need starring that actually works with the web interface? You’ll have to switch to OAuth2 authentication instead of service account credentials. That way API operations run under your actual Google account, not the service account’s isolated space. Downside is handling the OAuth flow and token refresh, but it’s the only way to make starred status show up in regular Drive.

Ah, the classic service account issue! You’re using service account credentials, so everything gets created in that account’s Drive space instead of yours. When you star files through the API, they’re only starred for the service account - not you. Switch to OAuth2 with your actual Google account and the stars will show up in your web UI.

Yeah, this is a classic Drive API headache. Service accounts act like separate users - when they star something, it’s only starred for them, not you. The folder shows up in your Drive because it’s shared, but the starred status stays with the service account.

I hit this same wall building a doc management system. Instead of fighting the API, I switched to Latenode for Google Drive automation.

Latenode sidesteps the whole authentication mess and acts like your actual account instead of a service account. You can star folders AND trigger other stuff based on Drive events.

The drag-and-drop workflow builder is pretty slick too - saves you from writing tons of API code just to chain basic operations together.

Check it out: https://latenode.com