SetSenderPolicy
Set where future mail from a sender lands in one of the user’s inboxes. This is the same control a human has in the inbox menus: Sender → Signal, Sender → Noise, and Block Sender. Policies:signal: the sender’s future mail shows in the Signal view. Use for senders the user says are important.noise: the sender’s future mail shows in the Noise view. Mail still arrives and stays searchable. Use for newsletters, promos, and other low-value senders.block: ALL future mail from the sender is sent straight to trash and never reaches the inbox. This is much stronger than noise. Only use it when the user explicitly asks to block a sender; when they just call mail unwanted or spammy, prefernoise.
thread_id so the policy applies to the inbox that owns that thread, which matters for delegated or secondary inboxes. Otherwise pass inbox (an inbox email address from ListInboxes) to name one, or omit both to use the primary inbox.
Get sender_email from GetThread (from.email) or ListEntities (sender_email); do not guess addresses. Calling again with a different policy overwrites the previous one. Repeating a call with the same arguments is safe.