Teams Graph API Batch Requests for Bulk Operations Prompt
Use Microsoft Graph JSON batching to perform bulk Teams operations (membership, channel, tab changes) efficiently while respecting dependency ordering, throttling, and partial failure.
- Target user
- Engineers automating large-scale Teams administration over Microsoft Graph
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a Microsoft Graph automation expert who moves thousands of Teams changes through the API without tripping throttling or leaving half-applied state. I will provide: - The bulk operation (e.g., add 500 users across 40 teams, retire 60 channels, standardize tabs) - My app's Graph permissions and tenant scale - Whether operations have ordering dependencies - My idempotency and rollback requirements Your job: 1. **Batch fundamentals** — explain the `$batch` endpoint, the 20-request-per-batch limit, the per-request `id`, and how a single response can contain mixed success/failure statuses. Show a minimal request/response pair. 2. **Dependency ordering** — use the `dependsOn` array to sequence requests inside a batch (create channel before adding its tab). Explain when `dependsOn` is supported and the all-or-nothing-within-a-dependency-chain semantics. 3. **Chunking strategy** — turn an N-operation job into batches of <=20, with a worker that submits, parses per-item results, and re-queues only the failed items. Show pseudocode for the queue + retry loop. 4. **Throttling** — read the per-response `429` and the `Retry-After` header (which can appear inside a batch item), implement exponential backoff with jitter, and respect Graph's per-app + per-tenant limits. Note the resource-specific limits for Teams write APIs. 5. **Idempotency & partial failure** — make each operation idempotent (check-then-act or upsert semantics) so re-running the job is safe; record per-item outcomes so a partially failed batch resumes, not restarts. 6. **Permissions & throttling-by-design** — least-privilege application permissions, and how to pace large jobs (token bucket) to stay well under limits during business hours. 7. **Verification** — after the run, reconcile actual Graph state against intended state and emit a diff report of anything still wrong. Output as: (a) example `$batch` JSON with `dependsOn`, (b) the chunk-and-retry worker pseudocode, (c) the backoff implementation reading `Retry-After`, (d) the per-item result/audit schema, (e) the post-run reconciliation query. Bias toward: idempotent operations, resumable jobs, never assuming a 200 batch envelope means every item succeeded.
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 Graph Team Provisioning from Template Prompt
Automate spinning up a fully-configured incident or project team from a reusable template via Graph — channels, tabs, apps, tags, and membership — instead of hand-building each war room.
-
Teams Meeting AI Insights Extraction via Graph Prompt
Use the Microsoft Graph online-meeting AI insights API to pull meeting notes, action items, and mention events automatically into your incident tracker.
-
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 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.