[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ERFM0M7059JK4VSWMJNX5K":3,"skill-same:01M7ERFM0M7059JK4VSWMJNX5K":150},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":46,"ownerDescription":6,"updatedAt":47,"install":48,"resources":61},"01M7ERFM0M7059JK4VSWMJNX5K","oauth",null,"Reference skill for Zoom authentication. Use after routing to an auth workflow when choosing app credentials, grant types, scopes, token refresh behavior, or debugging Zoom OAuth failures.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: oauth\ndescription: Reference skill for Zoom authentication. Use after routing to an auth workflow when choosing app credentials, grant types, scopes, token refresh behavior, or debugging Zoom OAuth failures.\nuser-invocable: false\ntriggers:\n  - zoom oauth\n  - zoom authentication\n  - zoom authorization\n  - server to server oauth\n  - s2s oauth\n  - zoom access token\n  - zoom refresh token\n  - authorization code flow\n  - device authorization\n  - pkce\n  - zoom api authentication\n  - oauth error 4709\n  - oauth error 4733\n  - oauth error 4735\n  - redirect uri mismatch\n---\n\n\u003C!-- Provenance: adapted from anthropics\u002Fknowledge-work-plugins (Apache-2.0, (c) Anthropic).\nOriginal skill: https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fknowledge-work-plugins\u002Ftree\u002Fmain\u002Fpartner-built\u002Fzoom-plugin\u002Fskills\u002Foauth. Changes for Muse AI: Claude\u002FCowork product refs -> Muse AI; MCP -> connector; CLAUDE.md -> MUSE.md; ${CLAUDE_PLUGIN_ROOT} -> this skill's directory; \u002Fplugin:command refs -> skill refs. -->\n\n\n# Zoom OAuth\n\nBackground reference for Zoom auth and token lifecycle behavior. Prefer `setup-zoom-oauth` first, then use this skill for the exact flow, scope, and error details.\n\n# Zoom OAuth\n\nAuthentication and authorization for Zoom APIs.\n\n## 📖 Complete Documentation\n\nFor comprehensive guides, production patterns, and troubleshooting, see **Integrated Index section below**.\n\nQuick navigation:\n- **[5-Minute Runbook](RUNBOOK.md)** - Preflight checks before deep debugging\n- **[OAuth Flows](concepts\u002Foauth-flows.md)** - Which flow to use and how each works\n- **[Token Lifecycle](concepts\u002Ftoken-lifecycle.md)** - Expiration, refresh, and revocation\n- **[Production Examples](examples\u002Fs2s-oauth-redis.md)** - Redis caching, MySQL storage, auto-refresh\n- **[Troubleshooting](troubleshooting\u002Fcommon-errors.md)** - Error codes 4700-4741\n\n## Prerequisites\n\n- Zoom app created in [Marketplace](https:\u002F\u002Fmarketplace.zoom.us\u002F)\n- Client ID and Client Secret\n- For S2S OAuth: Account ID\n\n## Four Authorization Use Cases\n\n| Use Case | App Type | Grant Type | Industry Name |\n|----------|----------|------------|---------------|\n| **Account Authorization** | Server-to-Server | `account_credentials` | Client Credentials Grant, M2M, Two-legged OAuth |\n| **User Authorization** | General | `authorization_code` | Authorization Code Grant, Three-legged OAuth |\n| **Device Authorization** | General | `urn:ietf:params:oauth:grant-type:device_code` | Device Authorization Grant (RFC 8628) |\n| **Client Authorization** | General | `client_credentials` | Client Credentials Grant (chatbot-scoped) |\n\n### Industry Terminology\n\n| Term | Meaning |\n|------|---------|\n| **Two-legged OAuth** | No user involved (client ↔ server) |\n| **Three-legged OAuth** | User involved (user ↔ client ↔ server) |\n| **M2M** | Machine-to-Machine (backend services) |\n| **Public client** | Can't keep secrets (mobile, SPA) → use PKCE |\n| **Confidential client** | Can keep secrets (backend servers) |\n| **PKCE** | Proof Key for Code Exchange (RFC 7636), pronounced \"pixy\" |\n\n### Which Flow Should I Use?\n\n```\n                              ┌─────────────────────┐\n                              │  What are you       │\n                              │  building?          │\n                              └──────────┬──────────┘\n                                         │\n                    ┌────────────────────┼────────────────────┐\n                    │                    │                    │\n                    ▼                    ▼                    ▼\n          ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐\n          │  Backend        │  │  App for other  │  │  Chatbot only   │\n          │  automation     │  │  users\u002Faccounts │  │  (Team Chat)    │\n          │  (your account) │  │                 │  │                 │\n          └────────┬────────┘  └────────┬────────┘  └────────┬────────┘\n                   │                    │                    │\n                   ▼                    │                    ▼\n          ┌─────────────────┐           │           ┌─────────────────┐\n          │    ACCOUNT      │           │           │     CLIENT      │\n          │   (S2S OAuth)   │           │           │   (Chatbot)     │\n          └─────────────────┘           │           └─────────────────┘\n                                        │\n                                        ▼\n                              ┌─────────────────────┐\n                              │  Does device have   │\n                              │  a browser?         │\n                              └──────────┬──────────┘\n                                         │\n                         ┌───────────────┴───────────────┐\n                         │ NO                         YES│\n                         ▼                               ▼\n          ┌─────────────────────────┐         ┌─────────────────┐\n          │        DEVICE           │         │      USER       │\n          │     (Device Flow)       │         │  (Auth Code)    │\n          │                         │         │                 │\n          │ Examples:               │         │ + PKCE if       │\n          │ • Smart TV              │         │   public client │\n          │ • Meeting SDK device    │         │                 │\n          └─────────────────────────┘         └─────────────────┘\n```\n\n---\n\n## Account Authorization (Server-to-Server OAuth)\n\nFor backend automation without user interaction.\n\n### Request Access Token\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=account_credentials&account_id={ACCOUNT_ID}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n### Response\n\n```json\n{\n  \"access_token\": \"eyJ...\",\n  \"token_type\": \"bearer\",\n  \"expires_in\": 3600,\n  \"scope\": \"user:read:user:admin\",\n  \"api_url\": \"https:\u002F\u002Fapi.zoom.us\"\n}\n```\n\n### Refresh\n\nAccess tokens expire after **1 hour**. No separate refresh flow - just request a new token.\n\n---\n\n## User Authorization (Authorization Code Flow)\n\nFor apps that act on behalf of users.\n\n### Step 1: Redirect User to Authorize\n\n```\nhttps:\u002F\u002Fzoom.us\u002Foauth\u002Fauthorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}\n```\n\nUse `https:\u002F\u002Fzoom.us\u002Foauth\u002Fauthorize` for consent, but `https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken` for token exchange.\n\n**Optional Parameters:**\n\n| Parameter | Description |\n|-----------|-------------|\n| `state` | CSRF protection, maintains state through flow |\n| `code_challenge` | For PKCE (see below) |\n| `code_challenge_method` | `S256` or `plain` (default: plain) |\n\n### Step 2: User Authorizes\n\n- User signs in and grants permission\n- Redirects to `redirect_uri` with authorization code:\n  ```\n  https:\u002F\u002Fexample.com\u002F?code={AUTHORIZATION_CODE}\n  ```\n\n### Step 3: Exchange Code for Token\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=authorization_code&code={CODE}&redirect_uri={REDIRECT_URI}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n**With PKCE:** Add `code_verifier` parameter.\n\n### Response\n\n```json\n{\n  \"access_token\": \"eyJ...\",\n  \"token_type\": \"bearer\",\n  \"refresh_token\": \"eyJ...\",\n  \"expires_in\": 3600,\n  \"scope\": \"user:read:user\",\n  \"api_url\": \"https:\u002F\u002Fapi.zoom.us\"\n}\n```\n\n### Refresh Token\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=refresh_token&refresh_token={REFRESH_TOKEN}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n- Access tokens expire after **1 hour**\n- Refresh token lifetime can vary; ~90 days is common for some user-based flows. Treat it as configuration\u002Fbehavior that can change and rely on runtime errors + re-auth fallback.\n- Always use the latest refresh token for the next request\n- If refresh token expires, redirect user to authorization URL to restart flow\n\n### User-Level vs Account-Level Apps\n\n| Type | Who Can Authorize | Scope Access |\n|------|-------------------|--------------|\n| **User-level** | Any individual user | Scoped to themselves |\n| **Account-level** | User with admin permissions | Account-wide access (admin scopes) |\n\n---\n\n## Device Authorization (Device Flow)\n\nFor devices without browsers (e.g., Meeting SDK apps).\n\n### Prerequisites\n\nEnable \"Use App on Device\" in: Features > Embed > Enable Meeting SDK\n\n### Step 1: Request Device Code\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Fdevicecode?client_id={CLIENT_ID}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n### Response\n\n```json\n{\n  \"device_code\": \"DEVICE_CODE\",\n  \"user_code\": \"abcd1234\",\n  \"verification_uri\": \"https:\u002F\u002Fzoom.us\u002Foauth_device\",\n  \"verification_uri_complete\": \"https:\u002F\u002Fzoom.us\u002Foauth\u002Fdevice\u002Fcomplete\u002F{CODE}\",\n  \"expires_in\": 900,\n  \"interval\": 5\n}\n```\n\n### Step 2: User Authorization\n\nDirect user to:\n- `verification_uri` and display `user_code` for manual entry, OR\n- `verification_uri_complete` (user code prefilled)\n\nUser signs in and allows the app.\n\n### Step 3: Poll for Token\n\nPoll at the `interval` (5 seconds) until user authorizes:\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=urn:ietf:params:oauth:grant-type:device_code&device_code={DEVICE_CODE}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n### Response\n\n```json\n{\n  \"access_token\": \"eyJ...\",\n  \"token_type\": \"bearer\",\n  \"refresh_token\": \"eyJ...\",\n  \"expires_in\": 3599,\n  \"scope\": \"user:read:user user:read:token\",\n  \"api_url\": \"https:\u002F\u002Fapi.zoom.us\"\n}\n```\n\n### Polling Responses\n\n| Response | Meaning | Action |\n|----------|---------|--------|\n| Token returned | User authorized | Store tokens, done |\n| `error: authorization_pending` | User hasn't authorized yet | Keep polling at interval |\n| `error: slow_down` | Polling too fast | Increase interval by 5 seconds |\n| `error: expired_token` | Device code expired (15 min) | Restart flow from Step 1 |\n| `error: access_denied` | User denied authorization | Handle denial, don't retry |\n\n### Polling Implementation\n\n```javascript\nasync function pollForToken(deviceCode, interval) {\n  while (true) {\n    await sleep(interval * 1000);\n    \n    try {\n      const response = await axios.post(\n        `https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=urn:ietf:params:oauth:grant-type:device_code&device_code=${deviceCode}`,\n        null,\n        { headers: { 'Authorization': `Basic ${credentials}` } }\n      );\n      return response.data; \u002F\u002F Success - got tokens\n    } catch (error) {\n      const err = error.response?.data?.error;\n      if (err === 'authorization_pending') continue;\n      if (err === 'slow_down') { interval += 5; continue; }\n      throw error; \u002F\u002F expired_token or access_denied\n    }\n  }\n}\n```\n\n### Refresh\n\nSame as User Authorization. If refresh token expires, restart device flow from Step 1.\n\n---\n\n## Client Authorization (Chatbot)\n\nFor chatbot message operations only.\n\n### Request Token\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=client_credentials\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n### Response\n\n```json\n{\n  \"access_token\": \"eyJ...\",\n  \"token_type\": \"bearer\",\n  \"expires_in\": 3600,\n  \"scope\": \"imchat:bot\",\n  \"api_url\": \"https:\u002F\u002Fapi.zoom.us\"\n}\n```\n\n### Refresh\n\nTokens expire after **1 hour**. No refresh flow - just request a new token.\n\n---\n\n## Using Access Tokens\n\n### Call API\n\n```bash\nGET https:\u002F\u002Fapi.zoom.us\u002Fv2\u002Fusers\u002Fme\n\nHeaders:\nAuthorization: Bearer {ACCESS_TOKEN}\n```\n\n### Me Context\n\nReplace `userID` with `me` to target the token's associated user:\n\n| Endpoint | Methods |\n|----------|---------|\n| `\u002Fv2\u002Fusers\u002Fme` | GET, PATCH |\n| `\u002Fv2\u002Fusers\u002Fme\u002Ftoken` | GET |\n| `\u002Fv2\u002Fusers\u002Fme\u002Fmeetings` | GET, POST |\n\n---\n\n## Revoke Access Token\n\nWorks for all authorization types.\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Frevoke?token={ACCESS_TOKEN}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n### Response\n\n```json\n{\n  \"status\": \"success\"\n}\n```\n\n---\n\n## PKCE (Proof Key for Code Exchange)\n\nFor public clients that can't securely store secrets (mobile apps, SPAs, desktop apps).\n\n### When to Use PKCE\n\n| Client Type | Use PKCE? | Why |\n|-------------|-----------|-----|\n| Mobile app | **Yes** | Can't securely store client secret |\n| Single Page App (SPA) | **Yes** | JavaScript is visible to users |\n| Desktop app | **Yes** | Binary can be decompiled |\n| Meeting SDK (client-side) | **Yes** | Runs on user's device |\n| Backend server | Optional | Can keep secrets, but PKCE adds security |\n\n### How PKCE Works\n\n```\n┌──────────┐                              ┌──────────┐                    ┌──────────┐\n│  Client  │                              │   Zoom   │                    │   Zoom   │\n│   App    │                              │  Auth    │                    │  Token   │\n└────┬─────┘                              └────┬─────┘                    └────┬─────┘\n     │                                         │                              │\n     │ 1. Generate code_verifier (random)      │                              │\n     │ 2. Create code_challenge = SHA256(verifier)                            │\n     │                                         │                              │\n     │ ─────── \u002Fauthorize + code_challenge ──► │                              │\n     │                                         │                              │\n     │ ◄────── authorization_code ──────────── │                              │\n     │                                         │                              │\n     │ ─────────────── \u002Ftoken + code_verifier ─┼────────────────────────────► │\n     │                                         │                              │\n     │                                         │     Verify: SHA256(verifier) │\n     │                                         │            == challenge      │\n     │                                         │                              │\n     │ ◄───────────────────────────────────────┼─────── access_token ──────── │\n     │                                         │                              │\n```\n\n### Implementation (Node.js)\n\n```javascript\nconst crypto = require('crypto');\n\nfunction generatePKCE() {\n  const verifier = crypto.randomBytes(32).toString('base64url');\n  const challenge = crypto.createHash('sha256').update(verifier).digest('base64url');\n  return { verifier, challenge };\n}\n\nconst pkce = generatePKCE();\n\nconst authUrl = `https:\u002F\u002Fzoom.us\u002Foauth\u002Fauthorize?` +\n  `response_type=code&` +\n  `client_id=${CLIENT_ID}&` +\n  `redirect_uri=${REDIRECT_URI}&` +\n  `code_challenge=${pkce.challenge}&` +\n  `code_challenge_method=S256`;\n\n\u002F\u002F Store pkce.verifier in session for callback\n```\n\n### Token Exchange with PKCE\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=authorization_code&code={CODE}&redirect_uri={REDIRECT_URI}&code_verifier={VERIFIER}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n---\n\n## Deauthorization\n\nWhen a user removes your app, Zoom sends a webhook to your Deauthorization Notification Endpoint URL.\n\n### Webhook Event\n\n```json\n{\n  \"event\": \"app_deauthorized\",\n  \"event_ts\": 1740439732278,\n  \"payload\": {\n    \"account_id\": \"ACCOUNT_ID\",\n    \"user_id\": \"USER_ID\",\n    \"signature\": \"SIGNATURE\",\n    \"deauthorization_time\": \"2019-06-17T13:52:28.632Z\",\n    \"client_id\": \"CLIENT_ID\"\n  }\n}\n```\n\n### Requirements\n\n- **Delete all associated user data** after receiving this event\n- **Verify webhook signature** (use secret token, verification token deprecated Oct 2023)\n- Only public apps receive deauthorization webhooks (not private\u002Fdev apps)\n\n---\n\n## Pre-Approval Flow\n\nSome Zoom accounts require Marketplace admin pre-approval before users can authorize apps.\n\n- Users can request pre-approval from their admin\n- Account-level apps (admin scopes) require appropriate role permissions\n\n---\n\n## Active Apps Notifier (AAN)\n\nIn-meeting feature showing apps with real-time access to content.\n\n- Displays icon + tooltip with app info, content type being accessed, approving account\n- Supported: Zoom client 5.6.7+, Meeting SDK 5.9.0+\n\n---\n\n## OAuth Scopes\n\n### Scope Types\n\n| Type | Description | For |\n|------|-------------|-----|\n| **Classic scopes** | Legacy scopes (user, admin, master levels) | Existing apps |\n| **Granular scopes** | New fine-grained scopes with optional support | New apps |\n\n### Classic Scopes\n\nFor previously-created apps. Three levels:\n- **User-level**: Access to individual user's data\n- **Admin-level**: Account-wide access, requires admin role\n- **Master-level**: For master-sub account setups, requires account owner\n\nFull list: https:\u002F\u002Fdevelopers.zoom.us\u002Fdocs\u002Fintegrations\u002Foauth-scopes\u002F\n\n### Granular Scopes\n\nFor new apps. Format: `\u003Cservice>:\u003Caction>:\u003Cdata_claim>:\u003Caccess>`\n\n| Component | Values |\n|-----------|--------|\n| **service** | `meeting`, `webinar`, `user`, `recording`, etc. |\n| **action** | `read`, `write`, `update`, `delete` |\n| **data_claim** | Data category (e.g., `participants`, `settings`) |\n| **access** | empty (user), `admin`, `master` |\n\nExample: `meeting:read:list_meetings:admin`\n\nFull list: https:\u002F\u002Fdevelopers.zoom.us\u002Fdocs\u002Fintegrations\u002Foauth-scopes-granular\u002F\n\n### Optional Scopes\n\nGranular scopes can be marked as **optional** - users choose whether to grant them.\n\n**Basic authorization** (uses build flow defaults):\n```\nhttps:\u002F\u002Fzoom.us\u002Foauth\u002Fauthorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}\n```\n\n**Advanced authorization** (custom scopes per request):\n```\nhttps:\u002F\u002Fzoom.us\u002Foauth\u002Fauthorize?client_id={CLIENT_ID}&response_type=code&redirect_uri={REDIRECT_URI}&scope={required_scopes}&optional_scope={optional_scopes}\n```\n\n**Include previously granted scopes:**\n```\nhttps:\u002F\u002Fzoom.us\u002Foauth\u002Fauthorize?...&include_granted_scopes&scope={additional_scopes}\n```\n\n### Migrating Classic to Granular\n\n1. Manage > select app > edit\n2. Scope page > Development tab > click **Migrate**\n3. Review auto-assigned granular scopes, remove unnecessary, mark optional\n4. Test\n5. Production tab > click **Migrate**\n\n**Notes:**\n- No review needed if only migrating or reducing scopes\n- Existing user tokens continue with classic scope values until re-authorization\n- New users get granular scopes after migration\n\n---\n\n## Common Error Codes\n\n| Code | Message | Solution |\n|------|---------|----------|\n| 4700 | Token cannot be empty | Check Authorization header has valid token |\n| 4702\u002F4704 | Invalid client | Verify Client ID and Client Secret |\n| 4705 | Grant type not supported | Use: `account_credentials`, `authorization_code`, `urn:ietf:params:oauth:grant-type:device_code`, or `client_credentials` |\n| 4706 | Client ID or secret missing | Add credentials to header or request params |\n| 4709 | Redirect URI mismatch | Ensure redirect_uri matches app configuration exactly (including trailing slash) |\n| 4711 | Refresh token invalid | Token scopes don't match client scopes |\n| 4717 | App has been disabled | Contact Zoom support |\n| 4733 | Code is expired | Authorization codes expire in 5 minutes - restart flow |\n| 4734 | Invalid authorization code | Regenerate authorization code |\n| 4735 | Owner of token does not exist | User was removed from account - re-authorize |\n| 4741 | Token has been revoked | Use the most recent token from latest authorization |\n\nSee `references\u002Foauth-errors.md` for complete error list.\n\n---\n\n## Quick Reference\n\n| Flow | Grant Type | Token Expiry | Refresh |\n|------|------------|--------------|---------|\n| Account (S2S) | `account_credentials` | 1 hour | Request new token |\n| User | `authorization_code` | 1 hour | Use refresh_token (90 day expiry) |\n| Device | `urn:ietf:params:oauth:grant-type:device_code` | 1 hour | Use refresh_token (90 day expiry) |\n| Client (Chatbot) | `client_credentials` | 1 hour | Request new token |\n\n---\n\n## Demo Guidance\n\nIf you build an OAuth demo app, document its runtime base URL in that demo project's own\nREADME or `.env.example`, not in this shared skill.\n\n## Resources\n\n- **OAuth docs**: https:\u002F\u002Fdevelopers.zoom.us\u002Fdocs\u002Fintegrations\u002Foauth\u002F\n- **S2S OAuth docs**: https:\u002F\u002Fdevelopers.zoom.us\u002Fdocs\u002Finternal-apps\u002Fs2s-oauth\u002F\n- **PKCE blog**: https:\u002F\u002Fdevelopers.zoom.us\u002Fblog\u002Fpcke-oauth-with-postman-rest-api\u002F\n- **Classic scopes**: https:\u002F\u002Fdevelopers.zoom.us\u002Fdocs\u002Fintegrations\u002Foauth-scopes\u002F\n- **Granular scopes**: https:\u002F\u002Fdevelopers.zoom.us\u002Fdocs\u002Fintegrations\u002Foauth-scopes-granular\u002F\n\n---\n\n## Integrated Index\n\n_This section was migrated from `SKILL.md`._\n\n## Quick Start Path\n\n**If you're new to Zoom OAuth, follow this order:**\n\n1. **Run preflight checks first** → [RUNBOOK.md](RUNBOOK.md)\n\n2. **Choose your OAuth flow** → [concepts\u002Foauth-flows.md](concepts\u002Foauth-flows.md)\n   - 4 flows: S2S (backend), User (SaaS), Device (no browser), Chatbot\n   - Decision matrix: Which flow fits your use case?\n\n3. **Understand token lifecycle** → [concepts\u002Ftoken-lifecycle.md](concepts\u002Ftoken-lifecycle.md)\n   - **CRITICAL**: How tokens expire, refresh, and revoke\n   - Common pitfalls: refresh token rotation\n\n4. **Implement your flow** → Jump to examples:\n   - Backend automation → [examples\u002Fs2s-oauth-redis.md](examples\u002Fs2s-oauth-redis.md)\n   - SaaS app → [examples\u002Fuser-oauth-mysql.md](examples\u002Fuser-oauth-mysql.md)\n   - Mobile\u002FSPA → [examples\u002Fpkce-implementation.md](examples\u002Fpkce-implementation.md)\n   - Device (TV\u002Fkiosk) → [examples\u002Fdevice-flow.md](examples\u002Fdevice-flow.md)\n\n5. **Fix redirect URI issues** → [troubleshooting\u002Fredirect-uri-issues.md](troubleshooting\u002Fredirect-uri-issues.md)\n   - Most common OAuth error: Redirect URI mismatch\n\n6. **Implement token refresh** → [examples\u002Ftoken-refresh.md](examples\u002Ftoken-refresh.md)\n   - Automatic middleware pattern\n   - Handle refresh token rotation\n\n7. **Troubleshoot errors** → [troubleshooting\u002Fcommon-errors.md](troubleshooting\u002Fcommon-errors.md)\n   - Error code tables (4700-4741 range)\n   - Quick diagnostic workflow\n\n---\n\n## Documentation Structure\n\n```\noauth\u002F\n├── SKILL.md                           # Main skill overview\n├── SKILL.md                           # This file - navigation guide\n│\n├── concepts\u002F                          # Core OAuth concepts\n│   ├── oauth-flows.md                # 4 flows: S2S, User, Device, Chatbot\n│   ├── token-lifecycle.md            # Expiration, refresh, revocation\n│   ├── pkce.md                       # PKCE security for public clients\n│   ├── scopes-architecture.md        # Classic vs Granular scopes\n│   └── state-parameter.md            # CSRF protection with state\n│\n├── examples\u002F                          # Complete working code\n│   ├── s2s-oauth-basic.md            # S2S OAuth minimal example\n│   ├── s2s-oauth-redis.md            # S2S OAuth with Redis caching (production)\n│   ├── user-oauth-basic.md           # User OAuth minimal example\n│   ├── user-oauth-mysql.md           # User OAuth with MySQL + encryption (production)\n│   ├── device-flow.md                # Device authorization flow\n│   ├── pkce-implementation.md        # PKCE for SPAs\u002Fmobile apps\n│   └── token-refresh.md              # Auto-refresh middleware pattern\n│\n├── troubleshooting\u002F                   # Problem solving guides\n│   ├── common-errors.md              # Error codes 4700-4741\n│   ├── redirect-uri-issues.md        # Most common OAuth error\n│   ├── token-issues.md               # Expired, revoked, invalid tokens\n│   └── scope-issues.md               # Scope mismatch errors\n│\n└── references\u002F                        # Reference documentation\n    ├── oauth-errors.md                # Complete error code reference\n    ├── classic-scopes.md              # Classic scope reference\n    └── granular-scopes.md             # Granular scope reference\n```\n\n---\n\n## By Use Case\n\n### I want to automate Zoom tasks on my own account\n1. [OAuth Flows](concepts\u002Foauth-flows.md#server-to-server-s2s-oauth) - S2S OAuth explained\n2. [S2S OAuth Redis](examples\u002Fs2s-oauth-redis.md) - Production pattern with Redis caching\n3. [Token Lifecycle](concepts\u002Ftoken-lifecycle.md) - 1hr token, no refresh\n\n### I want to build a SaaS app for other Zoom users\n1. [OAuth Flows](concepts\u002Foauth-flows.md#user-authorization-oauth) - User OAuth explained\n2. [User OAuth MySQL](examples\u002Fuser-oauth-mysql.md) - Production pattern with encryption\n3. [Token Refresh](examples\u002Ftoken-refresh.md) - Automatic refresh middleware\n4. [Redirect URI Issues](troubleshooting\u002Fredirect-uri-issues.md) - Fix most common error\n\n### I want to build a mobile or SPA app\n1. [PKCE](concepts\u002Fpkce.md) - Why PKCE is required for public clients\n2. [PKCE Implementation](examples\u002Fpkce-implementation.md) - Complete code example\n3. [State Parameter](concepts\u002Fstate-parameter.md) - CSRF protection\n\n### I want to build an app for devices without browsers (TV, kiosk)\n1. [OAuth Flows](concepts\u002Foauth-flows.md#device-authorization-flow) - Device flow explained\n2. [Device Flow Example](examples\u002Fdevice-flow.md) - Complete polling implementation\n3. [Common Errors](troubleshooting\u002Fcommon-errors.md) - Device-specific errors\n\n### I'm building a Team Chat bot\n1. [OAuth Flows](concepts\u002Foauth-flows.md#client-authorization-chatbot) - Chatbot flow explained\n2. [S2S OAuth Basic](examples\u002Fs2s-oauth-basic.md) - Similar pattern, different grant type\n3. [Scopes Architecture](concepts\u002Fscopes-architecture.md) - Chatbot-specific scopes\n\n### I'm getting redirect URI errors (4709)\n1. [Redirect URI Issues](troubleshooting\u002Fredirect-uri-issues.md) - **START HERE!**\n2. [Common Errors](troubleshooting\u002Fcommon-errors.md#4709-redirect-uri-mismatch) - Error details\n3. [User OAuth Basic](examples\u002Fuser-oauth-basic.md) - See correct pattern\n\n### I'm getting token errors (4700-4741)\n1. [Token Issues](troubleshooting\u002Ftoken-issues.md) - Diagnostic workflow\n2. [Token Lifecycle](concepts\u002Ftoken-lifecycle.md) - Understand expiration\n3. [Token Refresh](examples\u002Ftoken-refresh.md) - Implement auto-refresh\n4. [Common Errors](troubleshooting\u002Fcommon-errors.md) - Error code tables\n\n### I'm getting scope errors (4711)\n1. [Scope Issues](troubleshooting\u002Fscope-issues.md) - Mismatch causes\n2. [Scopes Architecture](concepts\u002Fscopes-architecture.md) - Classic vs Granular\n3. [Classic Scopes](references\u002Fclassic-scopes.md) - Complete scope reference\n4. [Granular Scopes](references\u002Fgranular-scopes.md) - Granular scope reference\n\n### I need to refresh tokens\n1. [Token Lifecycle](concepts\u002Ftoken-lifecycle.md#refresh-strategy) - When to refresh\n2. [Token Refresh](examples\u002Ftoken-refresh.md) - Middleware pattern\n3. [Token Issues](troubleshooting\u002Ftoken-issues.md#refresh-token-problems) - Common mistakes\n\n### I want to understand the difference between Classic and Granular scopes\n1. [Scopes Architecture](concepts\u002Fscopes-architecture.md) - **Complete comparison**\n2. [Classic Scopes](references\u002Fclassic-scopes.md) - `resource:level` format\n3. [Granular Scopes](references\u002Fgranular-scopes.md) - `service:action:data_claim:access` format\n\n### I need to secure my OAuth implementation\n1. [PKCE](concepts\u002Fpkce.md) - Public client security\n2. [State Parameter](concepts\u002Fstate-parameter.md) - CSRF protection\n3. [User OAuth MySQL](examples\u002Fuser-oauth-mysql.md#token-encryption) - Token encryption at rest\n\n### I want to migrate from JWT app to S2S OAuth\n1. [S2S OAuth Redis](examples\u002Fs2s-oauth-redis.md) - Modern replacement\n2. [Token Lifecycle](concepts\u002Ftoken-lifecycle.md) - Different token behavior\n\n> **Note**: JWT App Type was deprecated in June 2023. Migrate to S2S OAuth for server-to-server automation.\n\n---\n\n## Most Critical Documents\n\n### 1. OAuth Flows (DECISION DOCUMENT)\n**[concepts\u002Foauth-flows.md](concepts\u002Foauth-flows.md)**\n\nUnderstand which of the 4 flows to use:\n- **S2S OAuth**: Backend automation (your account)\n- **User OAuth**: SaaS apps (users authorize you)\n- **Device Flow**: Devices without browsers\n- **Chatbot**: Team Chat bots only\n\n### 2. Token Lifecycle (MOST COMMON ISSUE)\n**[concepts\u002Ftoken-lifecycle.md](concepts\u002Ftoken-lifecycle.md)**\n\n99% of OAuth issues stem from misunderstanding:\n- Token expiration (1 hour for all flows)\n- Refresh token rotation (must save new refresh token)\n- Revocation behavior (invalidates all tokens)\n\n### 3. Redirect URI Issues (MOST COMMON ERROR)\n**[troubleshooting\u002Fredirect-uri-issues.md](troubleshooting\u002Fredirect-uri-issues.md)**\n\nError 4709 (\"Redirect URI mismatch\") is the #1 OAuth error.\nMust match EXACTLY (including trailing slash, http vs https).\n\n---\n\n## Key Learnings\n\n### Critical Discoveries:\n\n1. **Refresh Token Rotation**\n   - Each refresh returns a NEW refresh token\n   - Old refresh token becomes invalid\n   - Failure to save new token causes 4735 errors\n   - See: [Token Refresh](examples\u002Ftoken-refresh.md)\n\n2. **S2S OAuth Uses Redis, User OAuth Uses Database**\n   - S2S: Single token for entire account → Redis (ephemeral)\n   - User: Per-user tokens → Database (persistent)\n   - See: [S2S OAuth Redis](examples\u002Fs2s-oauth-redis.md) vs [User OAuth MySQL](examples\u002Fuser-oauth-mysql.md)\n\n3. **Redirect URI Must Match EXACTLY**\n   - Trailing slash matters: `\u002Fcallback` ≠ `\u002Fcallback\u002F`\n   - Protocol matters: `http:\u002F\u002F` ≠ `https:\u002F\u002F`\n   - Port matters: `:3000` ≠ `:3001`\n   - See: [Redirect URI Issues](troubleshooting\u002Fredirect-uri-issues.md)\n\n4. **PKCE Required for Public Clients**\n   - Mobile apps CANNOT keep secrets\n   - SPAs CANNOT keep secrets\n   - PKCE prevents authorization code interception\n   - See: [PKCE](concepts\u002Fpkce.md)\n\n5. **State Parameter Prevents CSRF**\n   - Generate random state before redirect\n   - Store in session\n   - Verify on callback\n   - See: [State Parameter](concepts\u002Fstate-parameter.md)\n\n6. **Token Storage Must Be Encrypted**\n   - NEVER store tokens in plain text\n   - Use AES-256 minimum\n   - See: [User OAuth MySQL](examples\u002Fuser-oauth-mysql.md#token-encryption)\n\n7. **JWT App Type is Deprecated (June 2023)**\n   - No new JWT apps can be created\n   - Existing apps still work but will eventually be sunset\n   - Migrate to S2S OAuth or User OAuth\n\n8. **Scope Levels Determine Authorization Requirements**\n   - No suffix (user-level): Any user can authorize\n   - `:admin`: Requires admin role\n   - `:master`: Requires account owner (multi-account)\n   - See: [Scopes Architecture](concepts\u002Fscopes-architecture.md)\n\n9. **Authorization Codes Expire in 5 Minutes**\n   - Exchange code for token immediately\n   - Don't cache authorization codes\n   - See: [Token Lifecycle](concepts\u002Ftoken-lifecycle.md#authorization-code-expiration)\n\n10. **Device Flow Requires Polling**\n    - Poll at interval returned by `\u002Fdevicecode` (usually 5s)\n    - Handle `authorization_pending`, `slow_down`, `expired_token`\n    - See: [Device Flow](examples\u002Fdevice-flow.md)\n\n---\n\n## Quick Reference\n\n### \"Which OAuth flow should I use?\"\n→ [OAuth Flows](concepts\u002Foauth-flows.md)\n\n### \"Redirect URI mismatch error (4709)\"\n→ [Redirect URI Issues](troubleshooting\u002Fredirect-uri-issues.md)\n\n### \"Token expired or invalid\"\n→ [Token Issues](troubleshooting\u002Ftoken-issues.md)\n\n### \"Refresh token invalid (4735)\"\n→ [Token Refresh](examples\u002Ftoken-refresh.md) - Must save new refresh token\n\n### \"Scope mismatch error (4711)\"\n→ [Scope Issues](troubleshooting\u002Fscope-issues.md)\n\n### \"How do I secure my OAuth app?\"\n→ [PKCE](concepts\u002Fpkce.md) + [State Parameter](concepts\u002Fstate-parameter.md)\n\n### \"How do I implement auto-refresh?\"\n→ [Token Refresh](examples\u002Ftoken-refresh.md)\n\n### \"What's the difference between Classic and Granular scopes?\"\n→ [Scopes Architecture](concepts\u002Fscopes-architecture.md)\n\n### \"What error code means what?\"\n→ [Common Errors](troubleshooting\u002Fcommon-errors.md)\n\n---\n\n## Document Version\n\nBased on **Zoom OAuth API v2** (2024+)\n\n**Deprecated:** JWT App Type (June 2023)\n\n---\n\n**Happy coding!**\n\nRemember: Start with [OAuth Flows](concepts\u002Foauth-flows.md) to understand which flow fits your use case!\n\n## Environment Variables\n\n- See [references\u002Fenvironment-variables.md](references\u002Fenvironment-variables.md) for standardized `.env` keys and where to find each value.\n","\u003C!-- Provenance: adapted from anthropics\u002Fknowledge-work-plugins (Apache-2.0, (c) Anthropic).\nOriginal skill: https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fknowledge-work-plugins\u002Ftree\u002Fmain\u002Fpartner-built\u002Fzoom-plugin\u002Fskills\u002Foauth. Changes for Muse AI: Claude\u002FCowork product refs -> Muse AI; MCP -> connector; CLAUDE.md -> MUSE.md; ${CLAUDE_PLUGIN_ROOT} -> this skill's directory; \u002Fplugin:command refs -> skill refs. -->\n\n\n# Zoom OAuth\n\nBackground reference for Zoom auth and token lifecycle behavior. Prefer `setup-zoom-oauth` first, then use this skill for the exact flow, scope, and error details.\n\n# Zoom OAuth\n\nAuthentication and authorization for Zoom APIs.\n\n## 📖 Complete Documentation\n\nFor comprehensive guides, production patterns, and troubleshooting, see **Integrated Index section below**.\n\nQuick navigation:\n- **[5-Minute Runbook](RUNBOOK.md)** - Preflight checks before deep debugging\n- **[OAuth Flows](concepts\u002Foauth-flows.md)** - Which flow to use and how each works\n- **[Token Lifecycle](concepts\u002Ftoken-lifecycle.md)** - Expiration, refresh, and revocation\n- **[Production Examples](examples\u002Fs2s-oauth-redis.md)** - Redis caching, MySQL storage, auto-refresh\n- **[Troubleshooting](troubleshooting\u002Fcommon-errors.md)** - Error codes 4700-4741\n\n## Prerequisites\n\n- Zoom app created in [Marketplace](https:\u002F\u002Fmarketplace.zoom.us\u002F)\n- Client ID and Client Secret\n- For S2S OAuth: Account ID\n\n## Four Authorization Use Cases\n\n| Use Case | App Type | Grant Type | Industry Name |\n|----------|----------|------------|---------------|\n| **Account Authorization** | Server-to-Server | `account_credentials` | Client Credentials Grant, M2M, Two-legged OAuth |\n| **User Authorization** | General | `authorization_code` | Authorization Code Grant, Three-legged OAuth |\n| **Device Authorization** | General | `urn:ietf:params:oauth:grant-type:device_code` | Device Authorization Grant (RFC 8628) |\n| **Client Authorization** | General | `client_credentials` | Client Credentials Grant (chatbot-scoped) |\n\n### Industry Terminology\n\n| Term | Meaning |\n|------|---------|\n| **Two-legged OAuth** | No user involved (client ↔ server) |\n| **Three-legged OAuth** | User involved (user ↔ client ↔ server) |\n| **M2M** | Machine-to-Machine (backend services) |\n| **Public client** | Can't keep secrets (mobile, SPA) → use PKCE |\n| **Confidential client** | Can keep secrets (backend servers) |\n| **PKCE** | Proof Key for Code Exchange (RFC 7636), pronounced \"pixy\" |\n\n### Which Flow Should I Use?\n\n```\n                              ┌─────────────────────┐\n                              │  What are you       │\n                              │  building?          │\n                              └──────────┬──────────┘\n                                         │\n                    ┌────────────────────┼────────────────────┐\n                    │                    │                    │\n                    ▼                    ▼                    ▼\n          ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐\n          │  Backend        │  │  App for other  │  │  Chatbot only   │\n          │  automation     │  │  users\u002Faccounts │  │  (Team Chat)    │\n          │  (your account) │  │                 │  │                 │\n          └────────┬────────┘  └────────┬────────┘  └────────┬────────┘\n                   │                    │                    │\n                   ▼                    │                    ▼\n          ┌─────────────────┐           │           ┌─────────────────┐\n          │    ACCOUNT      │           │           │     CLIENT      │\n          │   (S2S OAuth)   │           │           │   (Chatbot)     │\n          └─────────────────┘           │           └─────────────────┘\n                                        │\n                                        ▼\n                              ┌─────────────────────┐\n                              │  Does device have   │\n                              │  a browser?         │\n                              └──────────┬──────────┘\n                                         │\n                         ┌───────────────┴───────────────┐\n                         │ NO                         YES│\n                         ▼                               ▼\n          ┌─────────────────────────┐         ┌─────────────────┐\n          │        DEVICE           │         │      USER       │\n          │     (Device Flow)       │         │  (Auth Code)    │\n          │                         │         │                 │\n          │ Examples:               │         │ + PKCE if       │\n          │ • Smart TV              │         │   public client │\n          │ • Meeting SDK device    │         │                 │\n          └─────────────────────────┘         └─────────────────┘\n```\n\n---\n\n## Account Authorization (Server-to-Server OAuth)\n\nFor backend automation without user interaction.\n\n### Request Access Token\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=account_credentials&account_id={ACCOUNT_ID}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n### Response\n\n```json\n{\n  \"access_token\": \"eyJ...\",\n  \"token_type\": \"bearer\",\n  \"expires_in\": 3600,\n  \"scope\": \"user:read:user:admin\",\n  \"api_url\": \"https:\u002F\u002Fapi.zoom.us\"\n}\n```\n\n### Refresh\n\nAccess tokens expire after **1 hour**. No separate refresh flow - just request a new token.\n\n---\n\n## User Authorization (Authorization Code Flow)\n\nFor apps that act on behalf of users.\n\n### Step 1: Redirect User to Authorize\n\n```\nhttps:\u002F\u002Fzoom.us\u002Foauth\u002Fauthorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}\n```\n\nUse `https:\u002F\u002Fzoom.us\u002Foauth\u002Fauthorize` for consent, but `https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken` for token exchange.\n\n**Optional Parameters:**\n\n| Parameter | Description |\n|-----------|-------------|\n| `state` | CSRF protection, maintains state through flow |\n| `code_challenge` | For PKCE (see below) |\n| `code_challenge_method` | `S256` or `plain` (default: plain) |\n\n### Step 2: User Authorizes\n\n- User signs in and grants permission\n- Redirects to `redirect_uri` with authorization code:\n  ```\n  https:\u002F\u002Fexample.com\u002F?code={AUTHORIZATION_CODE}\n  ```\n\n### Step 3: Exchange Code for Token\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=authorization_code&code={CODE}&redirect_uri={REDIRECT_URI}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n**With PKCE:** Add `code_verifier` parameter.\n\n### Response\n\n```json\n{\n  \"access_token\": \"eyJ...\",\n  \"token_type\": \"bearer\",\n  \"refresh_token\": \"eyJ...\",\n  \"expires_in\": 3600,\n  \"scope\": \"user:read:user\",\n  \"api_url\": \"https:\u002F\u002Fapi.zoom.us\"\n}\n```\n\n### Refresh Token\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=refresh_token&refresh_token={REFRESH_TOKEN}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n- Access tokens expire after **1 hour**\n- Refresh token lifetime can vary; ~90 days is common for some user-based flows. Treat it as configuration\u002Fbehavior that can change and rely on runtime errors + re-auth fallback.\n- Always use the latest refresh token for the next request\n- If refresh token expires, redirect user to authorization URL to restart flow\n\n### User-Level vs Account-Level Apps\n\n| Type | Who Can Authorize | Scope Access |\n|------|-------------------|--------------|\n| **User-level** | Any individual user | Scoped to themselves |\n| **Account-level** | User with admin permissions | Account-wide access (admin scopes) |\n\n---\n\n## Device Authorization (Device Flow)\n\nFor devices without browsers (e.g., Meeting SDK apps).\n\n### Prerequisites\n\nEnable \"Use App on Device\" in: Features > Embed > Enable Meeting SDK\n\n### Step 1: Request Device Code\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Fdevicecode?client_id={CLIENT_ID}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n### Response\n\n```json\n{\n  \"device_code\": \"DEVICE_CODE\",\n  \"user_code\": \"abcd1234\",\n  \"verification_uri\": \"https:\u002F\u002Fzoom.us\u002Foauth_device\",\n  \"verification_uri_complete\": \"https:\u002F\u002Fzoom.us\u002Foauth\u002Fdevice\u002Fcomplete\u002F{CODE}\",\n  \"expires_in\": 900,\n  \"interval\": 5\n}\n```\n\n### Step 2: User Authorization\n\nDirect user to:\n- `verification_uri` and display `user_code` for manual entry, OR\n- `verification_uri_complete` (user code prefilled)\n\nUser signs in and allows the app.\n\n### Step 3: Poll for Token\n\nPoll at the `interval` (5 seconds) until user authorizes:\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=urn:ietf:params:oauth:grant-type:device_code&device_code={DEVICE_CODE}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n### Response\n\n```json\n{\n  \"access_token\": \"eyJ...\",\n  \"token_type\": \"bearer\",\n  \"refresh_token\": \"eyJ...\",\n  \"expires_in\": 3599,\n  \"scope\": \"user:read:user user:read:token\",\n  \"api_url\": \"https:\u002F\u002Fapi.zoom.us\"\n}\n```\n\n### Polling Responses\n\n| Response | Meaning | Action |\n|----------|---------|--------|\n| Token returned | User authorized | Store tokens, done |\n| `error: authorization_pending` | User hasn't authorized yet | Keep polling at interval |\n| `error: slow_down` | Polling too fast | Increase interval by 5 seconds |\n| `error: expired_token` | Device code expired (15 min) | Restart flow from Step 1 |\n| `error: access_denied` | User denied authorization | Handle denial, don't retry |\n\n### Polling Implementation\n\n```javascript\nasync function pollForToken(deviceCode, interval) {\n  while (true) {\n    await sleep(interval * 1000);\n    \n    try {\n      const response = await axios.post(\n        `https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=urn:ietf:params:oauth:grant-type:device_code&device_code=${deviceCode}`,\n        null,\n        { headers: { 'Authorization': `Basic ${credentials}` } }\n      );\n      return response.data; \u002F\u002F Success - got tokens\n    } catch (error) {\n      const err = error.response?.data?.error;\n      if (err === 'authorization_pending') continue;\n      if (err === 'slow_down') { interval += 5; continue; }\n      throw error; \u002F\u002F expired_token or access_denied\n    }\n  }\n}\n```\n\n### Refresh\n\nSame as User Authorization. If refresh token expires, restart device flow from Step 1.\n\n---\n\n## Client Authorization (Chatbot)\n\nFor chatbot message operations only.\n\n### Request Token\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=client_credentials\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n### Response\n\n```json\n{\n  \"access_token\": \"eyJ...\",\n  \"token_type\": \"bearer\",\n  \"expires_in\": 3600,\n  \"scope\": \"imchat:bot\",\n  \"api_url\": \"https:\u002F\u002Fapi.zoom.us\"\n}\n```\n\n### Refresh\n\nTokens expire after **1 hour**. No refresh flow - just request a new token.\n\n---\n\n## Using Access Tokens\n\n### Call API\n\n```bash\nGET https:\u002F\u002Fapi.zoom.us\u002Fv2\u002Fusers\u002Fme\n\nHeaders:\nAuthorization: Bearer {ACCESS_TOKEN}\n```\n\n### Me Context\n\nReplace `userID` with `me` to target the token's associated user:\n\n| Endpoint | Methods |\n|----------|---------|\n| `\u002Fv2\u002Fusers\u002Fme` | GET, PATCH |\n| `\u002Fv2\u002Fusers\u002Fme\u002Ftoken` | GET |\n| `\u002Fv2\u002Fusers\u002Fme\u002Fmeetings` | GET, POST |\n\n---\n\n## Revoke Access Token\n\nWorks for all authorization types.\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Frevoke?token={ACCESS_TOKEN}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n### Response\n\n```json\n{\n  \"status\": \"success\"\n}\n```\n\n---\n\n## PKCE (Proof Key for Code Exchange)\n\nFor public clients that can't securely store secrets (mobile apps, SPAs, desktop apps).\n\n### When to Use PKCE\n\n| Client Type | Use PKCE? | Why |\n|-------------|-----------|-----|\n| Mobile app | **Yes** | Can't securely store client secret |\n| Single Page App (SPA) | **Yes** | JavaScript is visible to users |\n| Desktop app | **Yes** | Binary can be decompiled |\n| Meeting SDK (client-side) | **Yes** | Runs on user's device |\n| Backend server | Optional | Can keep secrets, but PKCE adds security |\n\n### How PKCE Works\n\n```\n┌──────────┐                              ┌──────────┐                    ┌──────────┐\n│  Client  │                              │   Zoom   │                    │   Zoom   │\n│   App    │                              │  Auth    │                    │  Token   │\n└────┬─────┘                              └────┬─────┘                    └────┬─────┘\n     │                                         │                              │\n     │ 1. Generate code_verifier (random)      │                              │\n     │ 2. Create code_challenge = SHA256(verifier)                            │\n     │                                         │                              │\n     │ ─────── \u002Fauthorize + code_challenge ──► │                              │\n     │                                         │                              │\n     │ ◄────── authorization_code ──────────── │                              │\n     │                                         │                              │\n     │ ─────────────── \u002Ftoken + code_verifier ─┼────────────────────────────► │\n     │                                         │                              │\n     │                                         │     Verify: SHA256(verifier) │\n     │                                         │            == challenge      │\n     │                                         │                              │\n     │ ◄───────────────────────────────────────┼─────── access_token ──────── │\n     │                                         │                              │\n```\n\n### Implementation (Node.js)\n\n```javascript\nconst crypto = require('crypto');\n\nfunction generatePKCE() {\n  const verifier = crypto.randomBytes(32).toString('base64url');\n  const challenge = crypto.createHash('sha256').update(verifier).digest('base64url');\n  return { verifier, challenge };\n}\n\nconst pkce = generatePKCE();\n\nconst authUrl = `https:\u002F\u002Fzoom.us\u002Foauth\u002Fauthorize?` +\n  `response_type=code&` +\n  `client_id=${CLIENT_ID}&` +\n  `redirect_uri=${REDIRECT_URI}&` +\n  `code_challenge=${pkce.challenge}&` +\n  `code_challenge_method=S256`;\n\n\u002F\u002F Store pkce.verifier in session for callback\n```\n\n### Token Exchange with PKCE\n\n```bash\nPOST https:\u002F\u002Fzoom.us\u002Foauth\u002Ftoken?grant_type=authorization_code&code={CODE}&redirect_uri={REDIRECT_URI}&code_verifier={VERIFIER}\n\nHeaders:\nAuthorization: Basic {Base64(ClientID:ClientSecret)}\n```\n\n---\n\n## Deauthorization\n\nWhen a user removes your app, Zoom sends a webhook to your Deauthorization Notification Endpoint URL.\n\n### Webhook Event\n\n```json\n{\n  \"event\": \"app_deauthorized\",\n  \"event_ts\": 1740439732278,\n  \"payload\": {\n    \"account_id\": \"ACCOUNT_ID\",\n    \"user_id\": \"USER_ID\",\n    \"signature\": \"SIGNATURE\",\n    \"deauthorization_time\": \"2019-06-17T13:52:28.632Z\",\n    \"client_id\": \"CLIENT_ID\"\n  }\n}\n```\n\n### Requirements\n\n- **Delete all associated user data** after receiving this event\n- **Verify webhook signature** (use secret token, verification token deprecated Oct 2023)\n- Only public apps receive deauthorization webhooks (not private\u002Fdev apps)\n\n---\n\n## Pre-Approval Flow\n\nSome Zoom accounts require Marketplace admin pre-approval before users can authorize apps.\n\n- Users can request pre-approval from their admin\n- Account-level apps (admin scopes) require appropriate role permissions\n\n---\n\n## Active Apps Notifier (AAN)\n\nIn-meeting feature showing apps with real-time access to content.\n\n- Displays icon + tooltip with app info, content type being accessed, approving account\n- Supported: Zoom client 5.6.7+, Meeting SDK 5.9.0+\n\n---\n\n## OAuth Scopes\n\n### Scope Types\n\n| Type | Description | For |\n|------|-------------|-----|\n| **Classic scopes** | Legacy scopes (user, admin, master levels) | Existing apps |\n| **Granular scopes** | New fine-grained scopes with optional support | New apps |\n\n### Classic Scopes\n\nFor previously-created apps. Three levels:\n- **User-level**: Access to individual user's data\n- **Admin-level**: Account-wide access, requires admin role\n- **Master-level**: For master-sub account setups, requires account owner\n\nFull list: https:\u002F\u002Fdevelopers.zoom.us\u002Fdocs\u002Fintegrations\u002Foauth-scopes\u002F\n\n### Granular Scopes\n\nFor new apps. Format: `\u003Cservice>:\u003Caction>:\u003Cdata_claim>:\u003Caccess>`\n\n| Component | Values |\n|-----------|--------|\n| **service** | `meeting`, `webinar`, `user`, `recording`, etc. |\n| **action** | `read`, `write`, `update`, `delete` |\n| **data_claim** | Data category (e.g., `participants`, `settings`) |\n| **access** | empty (user), `admin`, `master` |\n\nExample: `meeting:read:list_meetings:admin`\n\nFull list: https:\u002F\u002Fdevelopers.zoom.us\u002Fdocs\u002Fintegrations\u002Foauth-scopes-granular\u002F\n\n### Optional Scopes\n\nGranular scopes can be marked as **optional** - users choose whether to grant them.\n\n**Basic authorization** (uses build flow defaults):\n```\nhttps:\u002F\u002Fzoom.us\u002Foauth\u002Fauthorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}\n```\n\n**Advanced authorization** (custom scopes per request):\n```\nhttps:\u002F\u002Fzoom.us\u002Foauth\u002Fauthorize?client_id={CLIENT_ID}&response_type=code&redirect_uri={REDIRECT_URI}&scope={required_scopes}&optional_scope={optional_scopes}\n```\n\n**Include previously granted scopes:**\n```\nhttps:\u002F\u002Fzoom.us\u002Foauth\u002Fauthorize?...&include_granted_scopes&scope={additional_scopes}\n```\n\n### Migrating Classic to Granular\n\n1. Manage > select app > edit\n2. Scope page > Development tab > click **Migrate**\n3. Review auto-assigned granular scopes, remove unnecessary, mark optional\n4. Test\n5. Production tab > click **Migrate**\n\n**Notes:**\n- No review needed if only migrating or reducing scopes\n- Existing user tokens continue with classic scope values until re-authorization\n- New users get granular scopes after migration\n\n---\n\n## Common Error Codes\n\n| Code | Message | Solution |\n|------|---------|----------|\n| 4700 | Token cannot be empty | Check Authorization header has valid token |\n| 4702\u002F4704 | Invalid client | Verify Client ID and Client Secret |\n| 4705 | Grant type not supported | Use: `account_credentials`, `authorization_code`, `urn:ietf:params:oauth:grant-type:device_code`, or `client_credentials` |\n| 4706 | Client ID or secret missing | Add credentials to header or request params |\n| 4709 | Redirect URI mismatch | Ensure redirect_uri matches app configuration exactly (including trailing slash) |\n| 4711 | Refresh token invalid | Token scopes don't match client scopes |\n| 4717 | App has been disabled | Contact Zoom support |\n| 4733 | Code is expired | Authorization codes expire in 5 minutes - restart flow |\n| 4734 | Invalid authorization code | Regenerate authorization code |\n| 4735 | Owner of token does not exist | User was removed from account - re-authorize |\n| 4741 | Token has been revoked | Use the most recent token from latest authorization |\n\nSee `references\u002Foauth-errors.md` for complete error list.\n\n---\n\n## Quick Reference\n\n| Flow | Grant Type | Token Expiry | Refresh |\n|------|------------|--------------|---------|\n| Account (S2S) | `account_credentials` | 1 hour | Request new token |\n| User | `authorization_code` | 1 hour | Use refresh_token (90 day expiry) |\n| Device | `urn:ietf:params:oauth:grant-type:device_code` | 1 hour | Use refresh_token (90 day expiry) |\n| Client (Chatbot) | `client_credentials` | 1 hour | Request new token |\n\n---\n\n## Demo Guidance\n\nIf you build an OAuth demo app, document its runtime base URL in that demo project's own\nREADME or `.env.example`, not in this shared skill.\n\n## Resources\n\n- **OAuth docs**: https:\u002F\u002Fdevelopers.zoom.us\u002Fdocs\u002Fintegrations\u002Foauth\u002F\n- **S2S OAuth docs**: https:\u002F\u002Fdevelopers.zoom.us\u002Fdocs\u002Finternal-apps\u002Fs2s-oauth\u002F\n- **PKCE blog**: https:\u002F\u002Fdevelopers.zoom.us\u002Fblog\u002Fpcke-oauth-with-postman-rest-api\u002F\n- **Classic scopes**: https:\u002F\u002Fdevelopers.zoom.us\u002Fdocs\u002Fintegrations\u002Foauth-scopes\u002F\n- **Granular scopes**: https:\u002F\u002Fdevelopers.zoom.us\u002Fdocs\u002Fintegrations\u002Foauth-scopes-granular\u002F\n\n---\n\n## Integrated Index\n\n_This section was migrated from `SKILL.md`._\n\n## Quick Start Path\n\n**If you're new to Zoom OAuth, follow this order:**\n\n1. **Run preflight checks first** → [RUNBOOK.md](RUNBOOK.md)\n\n2. **Choose your OAuth flow** → [concepts\u002Foauth-flows.md](concepts\u002Foauth-flows.md)\n   - 4 flows: S2S (backend), User (SaaS), Device (no browser), Chatbot\n   - Decision matrix: Which flow fits your use case?\n\n3. **Understand token lifecycle** → [concepts\u002Ftoken-lifecycle.md](concepts\u002Ftoken-lifecycle.md)\n   - **CRITICAL**: How tokens expire, refresh, and revoke\n   - Common pitfalls: refresh token rotation\n\n4. **Implement your flow** → Jump to examples:\n   - Backend automation → [examples\u002Fs2s-oauth-redis.md](examples\u002Fs2s-oauth-redis.md)\n   - SaaS app → [examples\u002Fuser-oauth-mysql.md](examples\u002Fuser-oauth-mysql.md)\n   - Mobile\u002FSPA → [examples\u002Fpkce-implementation.md](examples\u002Fpkce-implementation.md)\n   - Device (TV\u002Fkiosk) → [examples\u002Fdevice-flow.md](examples\u002Fdevice-flow.md)\n\n5. **Fix redirect URI issues** → [troubleshooting\u002Fredirect-uri-issues.md](troubleshooting\u002Fredirect-uri-issues.md)\n   - Most common OAuth error: Redirect URI mismatch\n\n6. **Implement token refresh** → [examples\u002Ftoken-refresh.md](examples\u002Ftoken-refresh.md)\n   - Automatic middleware pattern\n   - Handle refresh token rotation\n\n7. **Troubleshoot errors** → [troubleshooting\u002Fcommon-errors.md](troubleshooting\u002Fcommon-errors.md)\n   - Error code tables (4700-4741 range)\n   - Quick diagnostic workflow\n\n---\n\n## Documentation Structure\n\n```\noauth\u002F\n├── SKILL.md                           # Main skill overview\n├── SKILL.md                           # This file - navigation guide\n│\n├── concepts\u002F                          # Core OAuth concepts\n│   ├── oauth-flows.md                # 4 flows: S2S, User, Device, Chatbot\n│   ├── token-lifecycle.md            # Expiration, refresh, revocation\n│   ├── pkce.md                       # PKCE security for public clients\n│   ├── scopes-architecture.md        # Classic vs Granular scopes\n│   └── state-parameter.md            # CSRF protection with state\n│\n├── examples\u002F                          # Complete working code\n│   ├── s2s-oauth-basic.md            # S2S OAuth minimal example\n│   ├── s2s-oauth-redis.md            # S2S OAuth with Redis caching (production)\n│   ├── user-oauth-basic.md           # User OAuth minimal example\n│   ├── user-oauth-mysql.md           # User OAuth with MySQL + encryption (production)\n│   ├── device-flow.md                # Device authorization flow\n│   ├── pkce-implementation.md        # PKCE for SPAs\u002Fmobile apps\n│   └── token-refresh.md              # Auto-refresh middleware pattern\n│\n├── troubleshooting\u002F                   # Problem solving guides\n│   ├── common-errors.md              # Error codes 4700-4741\n│   ├── redirect-uri-issues.md        # Most common OAuth error\n│   ├── token-issues.md               # Expired, revoked, invalid tokens\n│   └── scope-issues.md               # Scope mismatch errors\n│\n└── references\u002F                        # Reference documentation\n    ├── oauth-errors.md                # Complete error code reference\n    ├── classic-scopes.md              # Classic scope reference\n    └── granular-scopes.md             # Granular scope reference\n```\n\n---\n\n## By Use Case\n\n### I want to automate Zoom tasks on my own account\n1. [OAuth Flows](concepts\u002Foauth-flows.md#server-to-server-s2s-oauth) - S2S OAuth explained\n2. [S2S OAuth Redis](examples\u002Fs2s-oauth-redis.md) - Production pattern with Redis caching\n3. [Token Lifecycle](concepts\u002Ftoken-lifecycle.md) - 1hr token, no refresh\n\n### I want to build a SaaS app for other Zoom users\n1. [OAuth Flows](concepts\u002Foauth-flows.md#user-authorization-oauth) - User OAuth explained\n2. [User OAuth MySQL](examples\u002Fuser-oauth-mysql.md) - Production pattern with encryption\n3. [Token Refresh](examples\u002Ftoken-refresh.md) - Automatic refresh middleware\n4. [Redirect URI Issues](troubleshooting\u002Fredirect-uri-issues.md) - Fix most common error\n\n### I want to build a mobile or SPA app\n1. [PKCE](concepts\u002Fpkce.md) - Why PKCE is required for public clients\n2. [PKCE Implementation](examples\u002Fpkce-implementation.md) - Complete code example\n3. [State Parameter](concepts\u002Fstate-parameter.md) - CSRF protection\n\n### I want to build an app for devices without browsers (TV, kiosk)\n1. [OAuth Flows](concepts\u002Foauth-flows.md#device-authorization-flow) - Device flow explained\n2. [Device Flow Example](examples\u002Fdevice-flow.md) - Complete polling implementation\n3. [Common Errors](troubleshooting\u002Fcommon-errors.md) - Device-specific errors\n\n### I'm building a Team Chat bot\n1. [OAuth Flows](concepts\u002Foauth-flows.md#client-authorization-chatbot) - Chatbot flow explained\n2. [S2S OAuth Basic](examples\u002Fs2s-oauth-basic.md) - Similar pattern, different grant type\n3. [Scopes Architecture](concepts\u002Fscopes-architecture.md) - Chatbot-specific scopes\n\n### I'm getting redirect URI errors (4709)\n1. [Redirect URI Issues](troubleshooting\u002Fredirect-uri-issues.md) - **START HERE!**\n2. [Common Errors](troubleshooting\u002Fcommon-errors.md#4709-redirect-uri-mismatch) - Error details\n3. [User OAuth Basic](examples\u002Fuser-oauth-basic.md) - See correct pattern\n\n### I'm getting token errors (4700-4741)\n1. [Token Issues](troubleshooting\u002Ftoken-issues.md) - Diagnostic workflow\n2. [Token Lifecycle](concepts\u002Ftoken-lifecycle.md) - Understand expiration\n3. [Token Refresh](examples\u002Ftoken-refresh.md) - Implement auto-refresh\n4. [Common Errors](troubleshooting\u002Fcommon-errors.md) - Error code tables\n\n### I'm getting scope errors (4711)\n1. [Scope Issues](troubleshooting\u002Fscope-issues.md) - Mismatch causes\n2. [Scopes Architecture](concepts\u002Fscopes-architecture.md) - Classic vs Granular\n3. [Classic Scopes](references\u002Fclassic-scopes.md) - Complete scope reference\n4. [Granular Scopes](references\u002Fgranular-scopes.md) - Granular scope reference\n\n### I need to refresh tokens\n1. [Token Lifecycle](concepts\u002Ftoken-lifecycle.md#refresh-strategy) - When to refresh\n2. [Token Refresh](examples\u002Ftoken-refresh.md) - Middleware pattern\n3. [Token Issues](troubleshooting\u002Ftoken-issues.md#refresh-token-problems) - Common mistakes\n\n### I want to understand the difference between Classic and Granular scopes\n1. [Scopes Architecture](concepts\u002Fscopes-architecture.md) - **Complete comparison**\n2. [Classic Scopes](references\u002Fclassic-scopes.md) - `resource:level` format\n3. [Granular Scopes](references\u002Fgranular-scopes.md) - `service:action:data_claim:access` format\n\n### I need to secure my OAuth implementation\n1. [PKCE](concepts\u002Fpkce.md) - Public client security\n2. [State Parameter](concepts\u002Fstate-parameter.md) - CSRF protection\n3. [User OAuth MySQL](examples\u002Fuser-oauth-mysql.md#token-encryption) - Token encryption at rest\n\n### I want to migrate from JWT app to S2S OAuth\n1. [S2S OAuth Redis](examples\u002Fs2s-oauth-redis.md) - Modern replacement\n2. [Token Lifecycle](concepts\u002Ftoken-lifecycle.md) - Different token behavior\n\n> **Note**: JWT App Type was deprecated in June 2023. Migrate to S2S OAuth for server-to-server automation.\n\n---\n\n## Most Critical Documents\n\n### 1. OAuth Flows (DECISION DOCUMENT)\n**[concepts\u002Foauth-flows.md](concepts\u002Foauth-flows.md)**\n\nUnderstand which of the 4 flows to use:\n- **S2S OAuth**: Backend automation (your account)\n- **User OAuth**: SaaS apps (users authorize you)\n- **Device Flow**: Devices without browsers\n- **Chatbot**: Team Chat bots only\n\n### 2. Token Lifecycle (MOST COMMON ISSUE)\n**[concepts\u002Ftoken-lifecycle.md](concepts\u002Ftoken-lifecycle.md)**\n\n99% of OAuth issues stem from misunderstanding:\n- Token expiration (1 hour for all flows)\n- Refresh token rotation (must save new refresh token)\n- Revocation behavior (invalidates all tokens)\n\n### 3. Redirect URI Issues (MOST COMMON ERROR)\n**[troubleshooting\u002Fredirect-uri-issues.md](troubleshooting\u002Fredirect-uri-issues.md)**\n\nError 4709 (\"Redirect URI mismatch\") is the #1 OAuth error.\nMust match EXACTLY (including trailing slash, http vs https).\n\n---\n\n## Key Learnings\n\n### Critical Discoveries:\n\n1. **Refresh Token Rotation**\n   - Each refresh returns a NEW refresh token\n   - Old refresh token becomes invalid\n   - Failure to save new token causes 4735 errors\n   - See: [Token Refresh](examples\u002Ftoken-refresh.md)\n\n2. **S2S OAuth Uses Redis, User OAuth Uses Database**\n   - S2S: Single token for entire account → Redis (ephemeral)\n   - User: Per-user tokens → Database (persistent)\n   - See: [S2S OAuth Redis](examples\u002Fs2s-oauth-redis.md) vs [User OAuth MySQL](examples\u002Fuser-oauth-mysql.md)\n\n3. **Redirect URI Must Match EXACTLY**\n   - Trailing slash matters: `\u002Fcallback` ≠ `\u002Fcallback\u002F`\n   - Protocol matters: `http:\u002F\u002F` ≠ `https:\u002F\u002F`\n   - Port matters: `:3000` ≠ `:3001`\n   - See: [Redirect URI Issues](troubleshooting\u002Fredirect-uri-issues.md)\n\n4. **PKCE Required for Public Clients**\n   - Mobile apps CANNOT keep secrets\n   - SPAs CANNOT keep secrets\n   - PKCE prevents authorization code interception\n   - See: [PKCE](concepts\u002Fpkce.md)\n\n5. **State Parameter Prevents CSRF**\n   - Generate random state before redirect\n   - Store in session\n   - Verify on callback\n   - See: [State Parameter](concepts\u002Fstate-parameter.md)\n\n6. **Token Storage Must Be Encrypted**\n   - NEVER store tokens in plain text\n   - Use AES-256 minimum\n   - See: [User OAuth MySQL](examples\u002Fuser-oauth-mysql.md#token-encryption)\n\n7. **JWT App Type is Deprecated (June 2023)**\n   - No new JWT apps can be created\n   - Existing apps still work but will eventually be sunset\n   - Migrate to S2S OAuth or User OAuth\n\n8. **Scope Levels Determine Authorization Requirements**\n   - No suffix (user-level): Any user can authorize\n   - `:admin`: Requires admin role\n   - `:master`: Requires account owner (multi-account)\n   - See: [Scopes Architecture](concepts\u002Fscopes-architecture.md)\n\n9. **Authorization Codes Expire in 5 Minutes**\n   - Exchange code for token immediately\n   - Don't cache authorization codes\n   - See: [Token Lifecycle](concepts\u002Ftoken-lifecycle.md#authorization-code-expiration)\n\n10. **Device Flow Requires Polling**\n    - Poll at interval returned by `\u002Fdevicecode` (usually 5s)\n    - Handle `authorization_pending`, `slow_down`, `expired_token`\n    - See: [Device Flow](examples\u002Fdevice-flow.md)\n\n---\n\n## Quick Reference\n\n### \"Which OAuth flow should I use?\"\n→ [OAuth Flows](concepts\u002Foauth-flows.md)\n\n### \"Redirect URI mismatch error (4709)\"\n→ [Redirect URI Issues](troubleshooting\u002Fredirect-uri-issues.md)\n\n### \"Token expired or invalid\"\n→ [Token Issues](troubleshooting\u002Ftoken-issues.md)\n\n### \"Refresh token invalid (4735)\"\n→ [Token Refresh](examples\u002Ftoken-refresh.md) - Must save new refresh token\n\n### \"Scope mismatch error (4711)\"\n→ [Scope Issues](troubleshooting\u002Fscope-issues.md)\n\n### \"How do I secure my OAuth app?\"\n→ [PKCE](concepts\u002Fpkce.md) + [State Parameter](concepts\u002Fstate-parameter.md)\n\n### \"How do I implement auto-refresh?\"\n→ [Token Refresh](examples\u002Ftoken-refresh.md)\n\n### \"What's the difference between Classic and Granular scopes?\"\n→ [Scopes Architecture](concepts\u002Fscopes-architecture.md)\n\n### \"What error code means what?\"\n→ [Common Errors](troubleshooting\u002Fcommon-errors.md)\n\n---\n\n## Document Version\n\nBased on **Zoom OAuth API v2** (2024+)\n\n**Deprecated:** JWT App Type (June 2023)\n\n---\n\n**Happy coding!**\n\nRemember: Start with [OAuth Flows](concepts\u002Foauth-flows.md) to understand which flow fits your use case!\n\n## Environment Variables\n\n- See [references\u002Fenvironment-variables.md](references\u002Fenvironment-variables.md) for standardized `.env` keys and where to find each value.\n",{"name":5,"triggers":24,"description":7,"user-invocable":20},[25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],"zoom oauth","zoom authentication","zoom authorization","server to server oauth","s2s oauth","zoom access token","zoom refresh token","authorization code flow","device authorization","pkce","zoom api authentication","oauth error 4709","oauth error 4733","oauth error 4735","redirect uri mismatch","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-kw-oauth",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill oauth",{"tool":54,"command":55},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill oauth",{"tool":57,"command":58},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill oauth","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002FSKILL.md",true,[62,68,72,76,80,84,88,92,96,100,104,108,112,115,119,123,127,131,135,139,143,147],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"concepts\u002Foauth-flows.md","REFERENCE","参考文档",22724,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Fconcepts\u002Foauth-flows.md",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"concepts\u002Fpkce.md",14170,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Fconcepts\u002Fpkce.md",{"path":73,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":74,"sourceHtmlUrl":75},"concepts\u002Fscopes-architecture.md",6906,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Fconcepts\u002Fscopes-architecture.md",{"path":77,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":78,"sourceHtmlUrl":79},"concepts\u002Fstate-parameter.md",8313,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Fconcepts\u002Fstate-parameter.md",{"path":81,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":82,"sourceHtmlUrl":83},"concepts\u002Ftoken-lifecycle.md",15507,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Fconcepts\u002Ftoken-lifecycle.md",{"path":85,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":86,"sourceHtmlUrl":87},"CONNECTORS.md",2407,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002FCONNECTORS.md",{"path":89,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":90,"sourceHtmlUrl":91},"examples\u002Fdevice-flow.md",371,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Fexamples\u002Fdevice-flow.md",{"path":93,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":94,"sourceHtmlUrl":95},"examples\u002Fpkce-implementation.md",379,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Fexamples\u002Fpkce-implementation.md",{"path":97,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":98,"sourceHtmlUrl":99},"examples\u002Fs2s-oauth-basic.md",375,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Fexamples\u002Fs2s-oauth-basic.md",{"path":101,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":102,"sourceHtmlUrl":103},"examples\u002Fs2s-oauth-redis.md",6778,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Fexamples\u002Fs2s-oauth-redis.md",{"path":105,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":106,"sourceHtmlUrl":107},"examples\u002Ftoken-refresh.md",373,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Fexamples\u002Ftoken-refresh.md",{"path":109,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":110,"sourceHtmlUrl":111},"examples\u002Fuser-oauth-basic.md",376,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Fexamples\u002Fuser-oauth-basic.md",{"path":113,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":110,"sourceHtmlUrl":114},"examples\u002Fuser-oauth-mysql.md","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Fexamples\u002Fuser-oauth-mysql.md",{"path":116,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":117,"sourceHtmlUrl":118},"references\u002Fclassic-scopes.md",371007,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Freferences\u002Fclassic-scopes.md",{"path":120,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":121,"sourceHtmlUrl":122},"references\u002Fenvironment-variables.md",863,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Freferences\u002Fenvironment-variables.md",{"path":124,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":125,"sourceHtmlUrl":126},"references\u002Fgranular-scopes.md",377288,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Freferences\u002Fgranular-scopes.md",{"path":128,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":129,"sourceHtmlUrl":130},"references\u002Foauth-errors.md",4915,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Freferences\u002Foauth-errors.md",{"path":132,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":133,"sourceHtmlUrl":134},"RUNBOOK.md",3381,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002FRUNBOOK.md",{"path":136,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":137,"sourceHtmlUrl":138},"troubleshooting\u002Fcommon-errors.md",458,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Ftroubleshooting\u002Fcommon-errors.md",{"path":140,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":141,"sourceHtmlUrl":142},"troubleshooting\u002Fredirect-uri-issues.md",229,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Ftroubleshooting\u002Fredirect-uri-issues.md",{"path":144,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":145,"sourceHtmlUrl":146},"troubleshooting\u002Fscope-issues.md",222,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Ftroubleshooting\u002Fscope-issues.md",{"path":148,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":145,"sourceHtmlUrl":149},"troubleshooting\u002Ftoken-issues.md","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-kw-oauth\u002Ftroubleshooting\u002Ftoken-issues.md",[151,158,166,173,180,187],{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":162,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":179,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":191,"categories":192,"keywords":193,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]