{"skill":{"slug":"google-slides","displayName":"Google Slides","summary":"Google Slides API integration with managed OAuth. Create presentations, add slides, insert content, and manage slide formatting. Use this skill when users wa...","description":"---\nname: google-slides\ndescription: |\n  Google Slides API integration with managed OAuth. Create presentations, add slides, insert content, and manage slide formatting. Use this skill when users want to interact with Google Slides. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).\ncompatibility: Requires network access and valid Maton API key\nmetadata:\n  author: maton\n  version: \"1.0\"\n  clawdbot:\n    emoji: 🧠\n    requires:\n      env:\n        - MATON_API_KEY\n---\n\n# Google Slides\n\nAccess the Google Slides API with managed OAuth authentication. Create and manage presentations, add slides, insert text and images, and control formatting.\n\n## Quick Start\n\n```bash\n# Create a new presentation\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'title': 'My Presentation'}).encode()\nreq = urllib.request.Request('https://api.maton.ai/google-slides/v1/presentations', 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```\n\n## Base URL\n\n```\nhttps://api.maton.ai/google-slides/{native-api-path}\n```\n\nMaton proxies requests to `slides.googleapis.com` and automatically injects your OAuth token.\n\n## Authentication\n\nAll requests require the Maton API key in the Authorization header:\n\n```\nAuthorization: Bearer $MATON_API_KEY\n```\n\n**Environment Variable:** Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n### Getting Your API Key\n\n1. Sign in or create an account at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n\n## Connection Management\n\nManage your Google OAuth connections at `https://api.maton.ai`.\n\n### List Connections\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections?app=google-slides&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```\n\n### Create Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-slides'}).encode()\nreq = urllib.request.Request('https://api.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```\n\n### Get Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.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\n**Response:**\n```json\n{\n  \"connection\": {\n    \"connection_id\": \"{connection_id}\",\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-slides\",\n    \"metadata\": {}\n  }\n}\n```\n\nOpen the returned `url` in a browser to complete OAuth authorization.\n\n### Delete Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.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```\n\n### Specifying Connection\n\nIf you have multiple Google Slides connections, specify which one to use with the `Maton-Connection` header:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'title': 'My Presentation'}).encode()\nreq = urllib.request.Request('https://api.maton.ai/google-slides/v1/presentations', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nreq.add_header('Maton-Connection', '{connection_id}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\nIf you have multiple connections, always include this header to ensure requests go to the intended account.\n\n## Security & Permissions\n\n- Access is scoped to presentations, slides, and slide content within the connected Google Slides account.\n- **All write operations require explicit user approval.** Before executing any create, update, or delete call, confirm the target resource and intended effect with the user.\n\n## API Reference\n\n### Presentations\n\n#### Create Presentation\n\n```bash\nPOST /google-slides/v1/presentations\nContent-Type: application/json\n\n{\n  \"title\": \"My Presentation\"\n}\n```\n\n#### Get Presentation\n\n```bash\nGET /google-slides/v1/presentations/{presentationId}\n```\n\n### Pages (Slides)\n\n#### Get Page\n\n```bash\nGET /google-slides/v1/presentations/{presentationId}/pages/{pageId}\n```\n\n#### Get Page Thumbnail\n\n```bash\nGET /google-slides/v1/presentations/{presentationId}/pages/{pageId}/thumbnail\n```\n\nWith custom size:\n\n```bash\nGET /google-slides/v1/presentations/{presentationId}/pages/{pageId}/thumbnail?thumbnailProperties.mimeType=PNG&thumbnailProperties.thumbnailSize=LARGE\n```\n\n### Batch Update\n\nThe batchUpdate endpoint is used for most modifications. It accepts an array of requests that are applied atomically.\n\n```bash\nPOST /google-slides/v1/presentations/{presentationId}:batchUpdate\nContent-Type: application/json\n\n{\n  \"requests\": [...]\n}\n```\n\n#### Create Slide\n\n```bash\nPOST /google-slides/v1/presentations/{presentationId}:batchUpdate\nContent-Type: application/json\n\n{\n  \"requests\": [\n    {\n      \"createSlide\": {\n        \"objectId\": \"slide_001\",\n        \"slideLayoutReference\": {\n          \"predefinedLayout\": \"TITLE_AND_BODY\"\n        }\n      }\n    }\n  ]\n}\n```\n\nAvailable predefined layouts:\n- `BLANK`\n- `TITLE`\n- `TITLE_AND_BODY`\n- `TITLE_AND_TWO_COLUMNS`\n- `TITLE_ONLY`\n- `SECTION_HEADER`\n- `ONE_COLUMN_TEXT`\n- `MAIN_POINT`\n- `BIG_NUMBER`\n\n#### Insert Text\n\n```bash\nPOST /google-slides/v1/presentations/{presentationId}:batchUpdate\nContent-Type: application/json\n\n{\n  \"requests\": [\n    {\n      \"insertText\": {\n        \"objectId\": \"{shapeId}\",\n        \"text\": \"Hello, World!\",\n        \"insertionIndex\": 0\n      }\n    }\n  ]\n}\n```\n\n#### Delete Text\n\n```bash\nPOST /google-slides/v1/presentations/{presentationId}:batchUpdate\nContent-Type: application/json\n\n{\n  \"requests\": [\n    {\n      \"deleteText\": {\n        \"objectId\": \"{shapeId}\",\n        \"textRange\": {\n          \"type\": \"ALL\"\n        }\n      }\n    }\n  ]\n}\n```\n\n#### Create Shape\n\n```bash\nPOST /google-slides/v1/presentations/{presentationId}:batchUpdate\nContent-Type: application/json\n\n{\n  \"requests\": [\n    {\n      \"createShape\": {\n        \"objectId\": \"shape_001\",\n        \"shapeType\": \"TEXT_BOX\",\n        \"elementProperties\": {\n          \"pageObjectId\": \"{slideId}\",\n          \"size\": {\n            \"width\": {\"magnitude\": 300, \"unit\": \"PT\"},\n            \"height\": {\"magnitude\": 100, \"unit\": \"PT\"}\n          },\n          \"transform\": {\n            \"scaleX\": 1,\n            \"scaleY\": 1,\n            \"translateX\": 100,\n            \"translateY\": 100,\n            \"unit\": \"PT\"\n          }\n        }\n      }\n    }\n  ]\n}\n```\n\n#### Create Image\n\n```bash\nPOST /google-slides/v1/presentations/{presentationId}:batchUpdate\nContent-Type: application/json\n\n{\n  \"requests\": [\n    {\n      \"createImage\": {\n        \"objectId\": \"image_001\",\n        \"url\": \"https://example.com/image.png\",\n        \"elementProperties\": {\n          \"pageObjectId\": \"{slideId}\",\n          \"size\": {\n            \"width\": {\"magnitude\": 200, \"unit\": \"PT\"},\n            \"height\": {\"magnitude\": 200, \"unit\": \"PT\"}\n          },\n          \"transform\": {\n            \"scaleX\": 1,\n            \"scaleY\": 1,\n            \"translateX\": 200,\n            \"translateY\": 200,\n            \"unit\": \"PT\"\n          }\n        }\n      }\n    }\n  ]\n}\n```\n\n#### Delete Object\n\n```bash\nPOST /google-slides/v1/presentations/{presentationId}:batchUpdate\nContent-Type: application/json\n\n{\n  \"requests\": [\n    {\n      \"deleteObject\": {\n        \"objectId\": \"{objectId}\"\n      }\n    }\n  ]\n}\n```\n\n#### Update Text Style\n\n```bash\nPOST /google-slides/v1/presentations/{presentationId}:batchUpdate\nContent-Type: application/json\n\n{\n  \"requests\": [\n    {\n      \"updateTextStyle\": {\n        \"objectId\": \"{shapeId}\",\n        \"textRange\": {\n          \"type\": \"ALL\"\n        },\n        \"style\": {\n          \"bold\": true,\n          \"fontSize\": {\"magnitude\": 24, \"unit\": \"PT\"},\n          \"foregroundColor\": {\n            \"opaqueColor\": {\n              \"rgbColor\": {\"red\": 0.2, \"green\": 0.4, \"blue\": 0.8}\n            }\n          }\n        },\n        \"fields\": \"bold,fontSize,foregroundColor\"\n      }\n    }\n  ]\n}\n```\n\n#### Replace All Text\n\n```bash\nPOST /google-slides/v1/presentations/{presentationId}:batchUpdate\nContent-Type: application/json\n\n{\n  \"requests\": [\n    {\n      \"replaceAllText\": {\n        \"containsText\": {\n          \"text\": \"{{placeholder}}\",\n          \"matchCase\": true\n        },\n        \"replaceText\": \"Actual Value\"\n      }\n    }\n  ]\n}\n```\n\n## Code Examples\n\n### JavaScript\n\n```javascript\n// Create a presentation\nconst response = await fetch(\n  'https://api.maton.ai/google-slides/v1/presentations',\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    },\n    body: JSON.stringify({ title: 'My Presentation' })\n  }\n);\n\nconst presentation = await response.json();\nconst presentationId = presentation.presentationId;\n\n// Add a slide\nawait fetch(\n  `https://api.maton.ai/google-slides/v1/presentations/${presentationId}:batchUpdate`,\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    },\n    body: JSON.stringify({\n      requests: [\n        {\n          createSlide: {\n            slideLayoutReference: { predefinedLayout: 'TITLE_AND_BODY' }\n          }\n        }\n      ]\n    })\n  }\n);\n```\n\n### Python\n\n```python\nimport os\nimport requests\n\nheaders = {\n    'Content-Type': 'application/json',\n    'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'\n}\n\n# Create a presentation\nresponse = requests.post(\n    'https://api.maton.ai/google-slides/v1/presentations',\n    headers=headers,\n    json={'title': 'My Presentation'}\n)\npresentation = response.json()\npresentation_id = presentation['presentationId']\n\n# Add a slide\nrequests.post(\n    f'https://api.maton.ai/google-slides/v1/presentations/{presentation_id}:batchUpdate',\n    headers=headers,\n    json={\n        'requests': [\n            {\n                'createSlide': {\n                    'slideLayoutReference': {'predefinedLayout': 'TITLE_AND_BODY'}\n                }\n            }\n        ]\n    }\n)\n```\n\n## Notes\n\n- Object IDs must be unique within a presentation\n- Use batchUpdate for all modifications (adding slides, text, shapes, etc.)\n- Multiple requests in a batchUpdate are applied atomically\n- Sizes and positions use PT (points) as the unit (72 points = 1 inch)\n- Use `replaceAllText` for template-based presentation generation\n- IMPORTANT: When using curl commands, use `curl -g` when URLs contain brackets to disable glob parsing\n- IMPORTANT: 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.\n\n## Error Handling\n\n| Status | Meaning |\n|--------|---------|\n| 400 | Missing Google Slides connection |\n| 401 | Invalid or missing Maton API key |\n| 404 | Presentation not found |\n| 429 | Rate limited (10 req/sec per account) |\n| 4xx/5xx | Passthrough error from Google Slides API |\n\n### Troubleshooting: API Key Issues\n\n1. Check that the `MATON_API_KEY` environment variable is set:\n\n```bash\necho $MATON_API_KEY\n```\n\n2. Verify the API key is valid by listing connections:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.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```\n\n### Troubleshooting: Invalid App Name\n\n1. Ensure your URL path starts with `google-slides`. For example:\n\n- Correct: `https://api.maton.ai/google-slides/v1/presentations`\n- Incorrect: `https://api.maton.ai/slides/v1/presentations`\n\n## Resources\n\n- [Slides API Overview](https://developers.google.com/slides/api/reference/rest)\n- [Presentations](https://developers.google.com/slides/api/reference/rest/v1/presentations)\n- [Pages](https://developers.google.com/slides/api/reference/rest/v1/presentations.pages)\n- [BatchUpdate Requests](https://developers.google.com/slides/api/reference/rest/v1/presentations/batchUpdate)\n- [Page Layouts](https://developers.google.com/slides/api/reference/rest/v1/presentations/create#predefinedlayout)\n- [Maton Community](https://discord.com/invite/dBfFAcefs2)\n- [Maton Support](mailto:support@maton.ai)\n","topics":["Api Integration"],"tags":{"latest":"1.0.4"},"stats":{"comments":3,"downloads":19388,"installsAllTime":653,"installsCurrent":57,"stars":33,"versions":5},"createdAt":1770240848066,"updatedAt":1781739757511},"latestVersion":{"version":"1.0.4","createdAt":1777593128012,"changelog":"- Updated all endpoint base URLs from gateway.maton.ai and ctrl.maton.ai to api.maton.ai for consistency.\n- Added a \"Security & Permissions\" section clarifying access scope and write operation requirements.\n- Minor improvements to connection management instructions for clarity.\n- Removed LICENSE.txt file from the project.","license":"MIT-0"},"metadata":{"setup":[{"key":"MATON_API_KEY","required":true}],"os":null,"systems":null},"owner":{"handle":"byungkyu","userId":"s174c3s2kc1ehqj1ytzntezj2983e2aj","displayName":"byungkyu","image":"https://avatars.githubusercontent.com/u/16563684?v=4"},"moderation":null}