Drive API starred property modification not appearing in Google Drive interface

I’m having trouble with the Google Drive API when I try to mark a folder as starred. The API call seems to work fine and returns the correct response, but when I check the actual Google Drive web interface, the star doesn’t show up.

I can successfully update other properties like the folder name, but the starred status just won’t appear visually in Drive. I’ve waited over 20 minutes thinking it might be a delay issue, but still no luck.

Here’s my setup code for creating a directory:

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

from credentials import DRIVE_API_KEY, ROOT_DIR_ID

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

creds = ServiceAccountCredentials.from_json_keyfile_dict(
    DRIVE_API_KEY, API_SCOPES
)

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 attempt to modify both the name and starred status:

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

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

When I verify the changes 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 Google Drive web interface, there’s no star visible next to the folder. Has anyone encountered this issue before? Is there something I’m missing in my API calls?

I encountered this exact problem when building a document management system last year. The core issue is that service accounts maintain their own isolated Drive environment, completely separate from regular user accounts. When your service account stars a file, that starred status exists only within the service account’s context and will never propagate to any user’s personal Drive interface.

The workaround that worked for me was implementing a hybrid approach. I kept using service accounts for file creation and management operations, but switched to OAuth2 user flow specifically for actions that needed to be visible in the user interface, like starring files. You can also consider using custom properties instead of the starred field if you need to track special files for your application logic, since those can be read consistently regardless of the authentication method used.

yeah this happens becuase service accounts have their own seperate drive space. when you star something with a service account, its only starred in that service account’s view, not yours. try sharing the folder with your personal account first, then star it using oauth with your actual google account instead of the service account.

This is actually expected behavior when using service account credentials. The starred property you’re setting via the API only applies to the service account’s view of the file, not to your personal Google Drive account. Since service accounts operate independently from user accounts, any stars you set through the service account won’t be visible when you log into Google Drive with your regular user credentials. I ran into this same issue a few months back and spent way too much time debugging it. The solution depends on what you’re trying to achieve. If you need the star to be visible to actual users, you’ll need to use OAuth2 user credentials instead of service account credentials, which means the user would need to authenticate and grant permission to your application. Alternatively, if you’re just using the starred property for internal organization within your application, then the current setup works fine for programmatic access.