Teams Proactive App Install for Users via Graph Prompt
Programmatically install a Teams app for a list of users via Graph so a bot can proactively message them — fetching the conversation reference without waiting for the user to find the app.
- Target user
- Bot platform engineers enabling proactive messaging at onboarding scale
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who builds Microsoft Teams automation and proactive bot messaging using Graph app installation APIs.
I will provide:
- The target users (ids or UPNs) who should receive proactive bot messages
- The app's catalog app id and the bot's app/tenant credentials
- The reason for proactive contact (onboarding nudge, incident assignment)
Your job:
1. **Resolve the catalog app id** — query /appCatalogs/teamsApps with a filter to get the teamsApp id needed for installation, not the manifest id.
2. **Install per user** — POST to /users/{id}/teamwork/installedApps with TeamsApp.Read.All/ReadWriteSelfForUser permissions, handling the already-installed (409) case as success.
3. **Fetch the chat and conversation reference** — call installedApps/{id}/chat to get the personal chat, then construct the Bot Framework conversation reference for proactive sends.
4. **Send proactively with throttle awareness** — use continueConversation, batch with concurrency limits, and back off on 429 since proactive sends are heavily throttled.
5. **Make it idempotent and resumable** — checkpoint which users are installed and messaged so a re-run does not double-message.
6. **Respect consent and opt-out** — gate the campaign on legitimate need and honor an opt-out so it does not become spam.
Output as: the Graph calls in sequence, the conversation-reference construction code, the throttle-safe send loop, and an opt-out handling note.
Installing an app and messaging users they did not request is high-friction — confirm a legitimate business reason, batch within throttle limits, and always offer opt-out.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Teams Proactive Bot Messaging at Scale Prompt
Design reliable proactive (bot-initiated) Teams messaging at scale — capturing conversation references, app installation via Graph, throttling, retries, and per-user/per-channel delivery without spam.
-
Teams Bot File Attachment Handling for Log Bundles Prompt
Design a Teams bot that accepts dropped log bundles / diagnostics, validates and stores them, and returns analysis — handling both personal-chat file consent and channel file references via Graph.
-
Teams Bot Throttling & Retry Resilience Prompt
Design a Teams bot that survives Bot Framework and Graph 429 throttling — honoring Retry-After, batching proactive sends, and applying jittered backoff so incident-storm notification bursts never get dropped.
-
Teams Graph App Secret & Certificate Rotation Prompt
Design a zero-downtime rotation process for the Entra ID app registration credentials (client secrets or certificates) behind a Teams Graph integration, so bots and automation never break with AADSTS7000215 'invalid client secret' when a credential silently expires.
More Microsoft Teams prompts & error guides
Browse every Microsoft Teams prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.