domainwidedelegation.comStart free

Use cases → Email operations

Apply Gmail labels in bulk across user accounts

Add or update labels for many users at once using a delegated service account, without manual browser work.

Who it is forIT teams handling compliance, migrations, or inbox organisation for multiple users.
APIsGmail API
Typical scopesgmail.modify

The problem

Manually creating or updating labels for each user is time-consuming and error-prone, especially at scale. Even with admin access, the Gmail UI does not support bulk label actions across accounts.

How it works

  1. Enumerate target users from the directory or a provided list.
  2. Impersonate each user with the service account using domain-wide delegation.
  3. Check for the existence of the label; create it if missing.
  4. Apply or update the label on relevant threads or messages as required.

What changes

Labels are present and consistent across all targeted inboxes, with no manual intervention per user.

The trap in this one. Label IDs are unique per user and not stable across accounts, even if the label names match. If you store or reuse label IDs from one account in another, the API will silently fail to apply labels to messages, with no explicit error. Always look up or create the label in each user's mailbox and use the returned ID for that user’s subsequent operations.

Watch it explained

“Create multiple labels in Gmail with Google Apps Script” — saperis on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.

Questions people ask

Can I guarantee labels have the same colour and nesting for all users?

No. Label colour and nesting must be set individually per user. The API does not support a 'global label definition'.

Will users see the new labels immediately?

Usually yes, but label propagation in the Gmail UI can lag by several minutes, especially after bulk changes.

Want this built?

This is a pattern we run in production. We will set up the delegation and build this on top of it — $500 per hour, most of it working the same day.

Talk to us Or read the setup guide

Related use cases

Draft replies automatically in a shared inbox

A delegated service account reads an incoming enquiry, drafts a researched reply in the mailbox, and leaves it for a human to approve and send.

Triage and route inbound mail across a domain

Classify every inbound message, label it, and forward the ones that matter to the person who owns them — without touching a single mail rule.

Send mail as a shared alias from automation

Deliver notifications, confirmations and campaign replies from a branded address like support@ or updates@ without a human in the loop.