{
  "schemaVersion": "1.0",
  "item": {
    "slug": "google-workspace-admin",
    "name": "Google Workspace Admin",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/byungkyu/google-workspace-admin",
    "canonicalUrl": "https://clawhub.ai/byungkyu/google-workspace-admin",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/google-workspace-admin",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=google-workspace-admin",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "LICENSE.txt"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/google-workspace-admin"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/google-workspace-admin",
    "agentPageUrl": "https://openagent3.xyz/skills/google-workspace-admin/agent",
    "manifestUrl": "https://openagent3.xyz/skills/google-workspace-admin/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/google-workspace-admin/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Google Workspace Admin",
        "body": "Access the Google Workspace Admin SDK with managed OAuth authentication. Manage users, groups, organizational units, roles, and domain settings for Google Workspace."
      },
      {
        "title": "Quick Start",
        "body": "# List users in the domain\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer&maxResults=10')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Base URL",
        "body": "https://gateway.maton.ai/google-workspace-admin/{native-api-path}\n\nReplace {native-api-path} with the actual Admin SDK API endpoint path. The gateway proxies requests to admin.googleapis.com and automatically injects your OAuth token."
      },
      {
        "title": "Authentication",
        "body": "All requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\""
      },
      {
        "title": "Getting Your API Key",
        "body": "Sign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key"
      },
      {
        "title": "Connection Management",
        "body": "Manage your Google OAuth connections at https://ctrl.maton.ai."
      },
      {
        "title": "List Connections",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-workspace-admin&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Create Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-workspace-admin'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Get Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-workspace-admin\",\n    \"metadata\": {}\n  }\n}\n\nOpen the returned url in a browser to complete OAuth authorization."
      },
      {
        "title": "Delete Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Specifying Connection",
        "body": "If you have multiple Google Workspace Admin connections, specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nIf omitted, the gateway uses the default (oldest) active connection."
      },
      {
        "title": "Users",
        "body": "List Users\n\nGET /google-workspace-admin/admin/directory/v1/users?customer=my_customer&maxResults=100\n\nQuery parameters:\n\ncustomer - Customer ID or my_customer for your domain (required)\ndomain - Filter by specific domain\nmaxResults - Maximum results per page (1-500, default 100)\norderBy - Sort by email, familyName, or givenName\nquery - Search query (e.g., email:john*, name:John*)\npageToken - Token for pagination\n\nExample:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer&query=email:john*')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nResponse:\n\n{\n  \"kind\": \"admin#directory#users\",\n  \"users\": [\n    {\n      \"id\": \"123456789\",\n      \"primaryEmail\": \"john@example.com\",\n      \"name\": {\n        \"givenName\": \"John\",\n        \"familyName\": \"Doe\",\n        \"fullName\": \"John Doe\"\n      },\n      \"isAdmin\": false,\n      \"isDelegatedAdmin\": false,\n      \"suspended\": false,\n      \"creationTime\": \"2024-01-15T10:30:00.000Z\",\n      \"lastLoginTime\": \"2025-02-01T08:00:00.000Z\",\n      \"orgUnitPath\": \"/Sales\"\n    }\n  ],\n  \"nextPageToken\": \"...\"\n}\n\nGet User\n\nGET /google-workspace-admin/admin/directory/v1/users/{userKey}\n\nuserKey can be the user's primary email or unique user ID.\n\nCreate User\n\nPOST /google-workspace-admin/admin/directory/v1/users\nContent-Type: application/json\n\n{\n  \"primaryEmail\": \"newuser@example.com\",\n  \"name\": {\n    \"givenName\": \"Jane\",\n    \"familyName\": \"Smith\"\n  },\n  \"password\": \"temporaryPassword123!\",\n  \"changePasswordAtNextLogin\": true,\n  \"orgUnitPath\": \"/Engineering\"\n}\n\nUpdate User\n\nPUT /google-workspace-admin/admin/directory/v1/users/{userKey}\nContent-Type: application/json\n\n{\n  \"name\": {\n    \"givenName\": \"Jane\",\n    \"familyName\": \"Smith-Johnson\"\n  },\n  \"suspended\": false,\n  \"orgUnitPath\": \"/Sales\"\n}\n\nPatch User (partial update)\n\nPATCH /google-workspace-admin/admin/directory/v1/users/{userKey}\nContent-Type: application/json\n\n{\n  \"suspended\": true\n}\n\nDelete User\n\nDELETE /google-workspace-admin/admin/directory/v1/users/{userKey}\n\nMake User Admin\n\nPOST /google-workspace-admin/admin/directory/v1/users/{userKey}/makeAdmin\nContent-Type: application/json\n\n{\n  \"status\": true\n}"
      },
      {
        "title": "Groups",
        "body": "List Groups\n\nGET /google-workspace-admin/admin/directory/v1/groups?customer=my_customer\n\nQuery parameters:\n\ncustomer - Customer ID or my_customer (required)\ndomain - Filter by domain\nmaxResults - Maximum results (1-200)\nuserKey - List groups for a specific user\n\nGet Group\n\nGET /google-workspace-admin/admin/directory/v1/groups/{groupKey}\n\ngroupKey can be the group's email or unique ID.\n\nCreate Group\n\nPOST /google-workspace-admin/admin/directory/v1/groups\nContent-Type: application/json\n\n{\n  \"email\": \"engineering@example.com\",\n  \"name\": \"Engineering Team\",\n  \"description\": \"All engineering staff\"\n}\n\nUpdate Group\n\nPUT /google-workspace-admin/admin/directory/v1/groups/{groupKey}\nContent-Type: application/json\n\n{\n  \"name\": \"Engineering Department\",\n  \"description\": \"Updated description\"\n}\n\nDelete Group\n\nDELETE /google-workspace-admin/admin/directory/v1/groups/{groupKey}"
      },
      {
        "title": "Group Members",
        "body": "List Members\n\nGET /google-workspace-admin/admin/directory/v1/groups/{groupKey}/members\n\nAdd Member\n\nPOST /google-workspace-admin/admin/directory/v1/groups/{groupKey}/members\nContent-Type: application/json\n\n{\n  \"email\": \"user@example.com\",\n  \"role\": \"MEMBER\"\n}\n\nRoles: OWNER, MANAGER, MEMBER\n\nUpdate Member Role\n\nPATCH /google-workspace-admin/admin/directory/v1/groups/{groupKey}/members/{memberKey}\nContent-Type: application/json\n\n{\n  \"role\": \"MANAGER\"\n}\n\nRemove Member\n\nDELETE /google-workspace-admin/admin/directory/v1/groups/{groupKey}/members/{memberKey}"
      },
      {
        "title": "Organizational Units",
        "body": "List Org Units\n\nGET /google-workspace-admin/admin/directory/v1/customer/my_customer/orgunits\n\nQuery parameters:\n\ntype - all (default) or children\norgUnitPath - Parent org unit path\n\nGet Org Unit\n\nGET /google-workspace-admin/admin/directory/v1/customer/my_customer/orgunits/{orgUnitPath}\n\nCreate Org Unit\n\nPOST /google-workspace-admin/admin/directory/v1/customer/my_customer/orgunits\nContent-Type: application/json\n\n{\n  \"name\": \"Engineering\",\n  \"parentOrgUnitPath\": \"/\",\n  \"description\": \"Engineering department\"\n}\n\nUpdate Org Unit\n\nPUT /google-workspace-admin/admin/directory/v1/customer/my_customer/orgunits/{orgUnitPath}\nContent-Type: application/json\n\n{\n  \"description\": \"Updated description\"\n}\n\nDelete Org Unit\n\nDELETE /google-workspace-admin/admin/directory/v1/customer/my_customer/orgunits/{orgUnitPath}"
      },
      {
        "title": "Domains",
        "body": "List Domains\n\nGET /google-workspace-admin/admin/directory/v1/customer/my_customer/domains\n\nGet Domain\n\nGET /google-workspace-admin/admin/directory/v1/customer/my_customer/domains/{domainName}"
      },
      {
        "title": "Roles",
        "body": "List Roles\n\nGET /google-workspace-admin/admin/directory/v1/customer/my_customer/roles\n\nList Role Assignments\n\nGET /google-workspace-admin/admin/directory/v1/customer/my_customer/roleassignments\n\nQuery parameters:\n\nuserKey - Filter by user\nroleId - Filter by role\n\nCreate Role Assignment\n\nPOST /google-workspace-admin/admin/directory/v1/customer/my_customer/roleassignments\nContent-Type: application/json\n\n{\n  \"roleId\": \"123456789\",\n  \"assignedTo\": \"user_id\",\n  \"scopeType\": \"CUSTOMER\"\n}"
      },
      {
        "title": "JavaScript",
        "body": "const headers = {\n  'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n};\n\n// List users\nconst users = await fetch(\n  'https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer',\n  { headers }\n).then(r => r.json());\n\n// Create user\nawait fetch(\n  'https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users',\n  {\n    method: 'POST',\n    headers: { ...headers, 'Content-Type': 'application/json' },\n    body: JSON.stringify({\n      primaryEmail: 'newuser@example.com',\n      name: { givenName: 'New', familyName: 'User' },\n      password: 'TempPass123!',\n      changePasswordAtNextLogin: true\n    })\n  }\n);"
      },
      {
        "title": "Python",
        "body": "import os\nimport requests\n\nheaders = {'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'}\n\n# List users\nusers = requests.get(\n    'https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users',\n    headers=headers,\n    params={'customer': 'my_customer'}\n).json()\n\n# Create user\nresponse = requests.post(\n    'https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users',\n    headers=headers,\n    json={\n        'primaryEmail': 'newuser@example.com',\n        'name': {'givenName': 'New', 'familyName': 'User'},\n        'password': 'TempPass123!',\n        'changePasswordAtNextLogin': True\n    }\n)"
      },
      {
        "title": "Notes",
        "body": "Use my_customer as the customer ID for your own domain\nUser keys can be primary email or unique user ID\nGroup keys can be group email or unique group ID\nOrg unit paths start with / (e.g., /Engineering/Frontend)\nAdmin privileges are required for most operations\nPassword must meet Google's complexity requirements\nIMPORTANT: When using curl commands, use curl -g when URLs contain brackets (fields[], sort[], records[]) to disable glob parsing\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping."
      },
      {
        "title": "Error Handling",
        "body": "StatusMeaning400Missing Google Workspace Admin connection401Invalid or missing Maton API key403Insufficient admin privileges404User, group, or resource not found429Rate limited (10 req/sec per account)4xx/5xxPassthrough error from Admin SDK API"
      },
      {
        "title": "Troubleshooting: API Key Issues",
        "body": "Check that the MATON_API_KEY environment variable is set:\n\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Troubleshooting: Invalid App Name",
        "body": "Ensure your URL path starts with google-workspace-admin. For example:\n\nCorrect: https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer\nIncorrect: https://gateway.maton.ai/admin/directory/v1/users?customer=my_customer"
      },
      {
        "title": "Resources",
        "body": "Admin SDK Overview\nDirectory API Users\nDirectory API Groups\nDirectory API Members\nDirectory API Org Units\nDirectory API Domains\nDirectory API Roles\nAdmin SDK Guides\nMaton Community\nMaton Support"
      }
    ],
    "body": "Google Workspace Admin\n\nAccess the Google Workspace Admin SDK with managed OAuth authentication. Manage users, groups, organizational units, roles, and domain settings for Google Workspace.\n\nQuick Start\n# List users in the domain\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer&maxResults=10')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nBase URL\nhttps://gateway.maton.ai/google-workspace-admin/{native-api-path}\n\n\nReplace {native-api-path} with the actual Admin SDK API endpoint path. The gateway proxies requests to admin.googleapis.com and automatically injects your OAuth token.\n\nAuthentication\n\nAll requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n\nGetting Your API Key\nSign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key\nConnection Management\n\nManage your Google OAuth connections at https://ctrl.maton.ai.\n\nList Connections\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-workspace-admin&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nCreate Connection\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-workspace-admin'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nGet Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-workspace-admin\",\n    \"metadata\": {}\n  }\n}\n\n\nOpen the returned url in a browser to complete OAuth authorization.\n\nDelete Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nSpecifying Connection\n\nIf you have multiple Google Workspace Admin connections, specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\nAPI Reference\nUsers\nList Users\nGET /google-workspace-admin/admin/directory/v1/users?customer=my_customer&maxResults=100\n\n\nQuery parameters:\n\ncustomer - Customer ID or my_customer for your domain (required)\ndomain - Filter by specific domain\nmaxResults - Maximum results per page (1-500, default 100)\norderBy - Sort by email, familyName, or givenName\nquery - Search query (e.g., email:john*, name:John*)\npageToken - Token for pagination\n\nExample:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer&query=email:john*')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nResponse:\n\n{\n  \"kind\": \"admin#directory#users\",\n  \"users\": [\n    {\n      \"id\": \"123456789\",\n      \"primaryEmail\": \"john@example.com\",\n      \"name\": {\n        \"givenName\": \"John\",\n        \"familyName\": \"Doe\",\n        \"fullName\": \"John Doe\"\n      },\n      \"isAdmin\": false,\n      \"isDelegatedAdmin\": false,\n      \"suspended\": false,\n      \"creationTime\": \"2024-01-15T10:30:00.000Z\",\n      \"lastLoginTime\": \"2025-02-01T08:00:00.000Z\",\n      \"orgUnitPath\": \"/Sales\"\n    }\n  ],\n  \"nextPageToken\": \"...\"\n}\n\nGet User\nGET /google-workspace-admin/admin/directory/v1/users/{userKey}\n\n\nuserKey can be the user's primary email or unique user ID.\n\nCreate User\nPOST /google-workspace-admin/admin/directory/v1/users\nContent-Type: application/json\n\n{\n  \"primaryEmail\": \"newuser@example.com\",\n  \"name\": {\n    \"givenName\": \"Jane\",\n    \"familyName\": \"Smith\"\n  },\n  \"password\": \"temporaryPassword123!\",\n  \"changePasswordAtNextLogin\": true,\n  \"orgUnitPath\": \"/Engineering\"\n}\n\nUpdate User\nPUT /google-workspace-admin/admin/directory/v1/users/{userKey}\nContent-Type: application/json\n\n{\n  \"name\": {\n    \"givenName\": \"Jane\",\n    \"familyName\": \"Smith-Johnson\"\n  },\n  \"suspended\": false,\n  \"orgUnitPath\": \"/Sales\"\n}\n\nPatch User (partial update)\nPATCH /google-workspace-admin/admin/directory/v1/users/{userKey}\nContent-Type: application/json\n\n{\n  \"suspended\": true\n}\n\nDelete User\nDELETE /google-workspace-admin/admin/directory/v1/users/{userKey}\n\nMake User Admin\nPOST /google-workspace-admin/admin/directory/v1/users/{userKey}/makeAdmin\nContent-Type: application/json\n\n{\n  \"status\": true\n}\n\nGroups\nList Groups\nGET /google-workspace-admin/admin/directory/v1/groups?customer=my_customer\n\n\nQuery parameters:\n\ncustomer - Customer ID or my_customer (required)\ndomain - Filter by domain\nmaxResults - Maximum results (1-200)\nuserKey - List groups for a specific user\nGet Group\nGET /google-workspace-admin/admin/directory/v1/groups/{groupKey}\n\n\ngroupKey can be the group's email or unique ID.\n\nCreate Group\nPOST /google-workspace-admin/admin/directory/v1/groups\nContent-Type: application/json\n\n{\n  \"email\": \"engineering@example.com\",\n  \"name\": \"Engineering Team\",\n  \"description\": \"All engineering staff\"\n}\n\nUpdate Group\nPUT /google-workspace-admin/admin/directory/v1/groups/{groupKey}\nContent-Type: application/json\n\n{\n  \"name\": \"Engineering Department\",\n  \"description\": \"Updated description\"\n}\n\nDelete Group\nDELETE /google-workspace-admin/admin/directory/v1/groups/{groupKey}\n\nGroup Members\nList Members\nGET /google-workspace-admin/admin/directory/v1/groups/{groupKey}/members\n\nAdd Member\nPOST /google-workspace-admin/admin/directory/v1/groups/{groupKey}/members\nContent-Type: application/json\n\n{\n  \"email\": \"user@example.com\",\n  \"role\": \"MEMBER\"\n}\n\n\nRoles: OWNER, MANAGER, MEMBER\n\nUpdate Member Role\nPATCH /google-workspace-admin/admin/directory/v1/groups/{groupKey}/members/{memberKey}\nContent-Type: application/json\n\n{\n  \"role\": \"MANAGER\"\n}\n\nRemove Member\nDELETE /google-workspace-admin/admin/directory/v1/groups/{groupKey}/members/{memberKey}\n\nOrganizational Units\nList Org Units\nGET /google-workspace-admin/admin/directory/v1/customer/my_customer/orgunits\n\n\nQuery parameters:\n\ntype - all (default) or children\norgUnitPath - Parent org unit path\nGet Org Unit\nGET /google-workspace-admin/admin/directory/v1/customer/my_customer/orgunits/{orgUnitPath}\n\nCreate Org Unit\nPOST /google-workspace-admin/admin/directory/v1/customer/my_customer/orgunits\nContent-Type: application/json\n\n{\n  \"name\": \"Engineering\",\n  \"parentOrgUnitPath\": \"/\",\n  \"description\": \"Engineering department\"\n}\n\nUpdate Org Unit\nPUT /google-workspace-admin/admin/directory/v1/customer/my_customer/orgunits/{orgUnitPath}\nContent-Type: application/json\n\n{\n  \"description\": \"Updated description\"\n}\n\nDelete Org Unit\nDELETE /google-workspace-admin/admin/directory/v1/customer/my_customer/orgunits/{orgUnitPath}\n\nDomains\nList Domains\nGET /google-workspace-admin/admin/directory/v1/customer/my_customer/domains\n\nGet Domain\nGET /google-workspace-admin/admin/directory/v1/customer/my_customer/domains/{domainName}\n\nRoles\nList Roles\nGET /google-workspace-admin/admin/directory/v1/customer/my_customer/roles\n\nList Role Assignments\nGET /google-workspace-admin/admin/directory/v1/customer/my_customer/roleassignments\n\n\nQuery parameters:\n\nuserKey - Filter by user\nroleId - Filter by role\nCreate Role Assignment\nPOST /google-workspace-admin/admin/directory/v1/customer/my_customer/roleassignments\nContent-Type: application/json\n\n{\n  \"roleId\": \"123456789\",\n  \"assignedTo\": \"user_id\",\n  \"scopeType\": \"CUSTOMER\"\n}\n\nCode Examples\nJavaScript\nconst headers = {\n  'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n};\n\n// List users\nconst users = await fetch(\n  'https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer',\n  { headers }\n).then(r => r.json());\n\n// Create user\nawait fetch(\n  'https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users',\n  {\n    method: 'POST',\n    headers: { ...headers, 'Content-Type': 'application/json' },\n    body: JSON.stringify({\n      primaryEmail: 'newuser@example.com',\n      name: { givenName: 'New', familyName: 'User' },\n      password: 'TempPass123!',\n      changePasswordAtNextLogin: true\n    })\n  }\n);\n\nPython\nimport os\nimport requests\n\nheaders = {'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'}\n\n# List users\nusers = requests.get(\n    'https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users',\n    headers=headers,\n    params={'customer': 'my_customer'}\n).json()\n\n# Create user\nresponse = requests.post(\n    'https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users',\n    headers=headers,\n    json={\n        'primaryEmail': 'newuser@example.com',\n        'name': {'givenName': 'New', 'familyName': 'User'},\n        'password': 'TempPass123!',\n        'changePasswordAtNextLogin': True\n    }\n)\n\nNotes\nUse my_customer as the customer ID for your own domain\nUser keys can be primary email or unique user ID\nGroup keys can be group email or unique group ID\nOrg unit paths start with / (e.g., /Engineering/Frontend)\nAdmin privileges are required for most operations\nPassword must meet Google's complexity requirements\nIMPORTANT: When using curl commands, use curl -g when URLs contain brackets (fields[], sort[], records[]) to disable glob parsing\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping.\nError Handling\nStatus\tMeaning\n400\tMissing Google Workspace Admin connection\n401\tInvalid or missing Maton API key\n403\tInsufficient admin privileges\n404\tUser, group, or resource not found\n429\tRate limited (10 req/sec per account)\n4xx/5xx\tPassthrough error from Admin SDK API\nTroubleshooting: API Key Issues\nCheck that the MATON_API_KEY environment variable is set:\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nTroubleshooting: Invalid App Name\nEnsure your URL path starts with google-workspace-admin. For example:\nCorrect: https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer\nIncorrect: https://gateway.maton.ai/admin/directory/v1/users?customer=my_customer\nResources\nAdmin SDK Overview\nDirectory API Users\nDirectory API Groups\nDirectory API Members\nDirectory API Org Units\nDirectory API Domains\nDirectory API Roles\nAdmin SDK Guides\nMaton Community\nMaton Support"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/byungkyu/google-workspace-admin",
    "publisherUrl": "https://clawhub.ai/byungkyu/google-workspace-admin",
    "owner": "byungkyu",
    "version": "1.0.4",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/google-workspace-admin",
    "downloadUrl": "https://openagent3.xyz/downloads/google-workspace-admin",
    "agentUrl": "https://openagent3.xyz/skills/google-workspace-admin/agent",
    "manifestUrl": "https://openagent3.xyz/skills/google-workspace-admin/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/google-workspace-admin/agent.md"
  }
}