简介
Zoho Mail
原始描述
Zoho Mail API integration with managed OAuth. Send, receive, and manage emails, folders, and labels. Use this skill when users want to send emails, read mess...
通过你的 Agent 添加
安装目录:zoho-mail/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Zoho Mail Skill 是 Maton 提供的 API 网关集成服务,允许开发者通过统一的 REST API 接口操作 Zoho Mail 账户。核心功能涵盖:账户管理、文件夹/标签 CRUD、邮件收发(含 HTML/纯文本格式、定时发送、已读回执)、邮件搜索与分页浏览、附件上传下载、以及批量操作(标记已读/未读、归档、标记垃圾邮件等)。
所有请求通过 gateway.maton.ai 代理转发至 Zoho 官方 API,Maton 自动处理 OAuth token 注入,开发者仅需提供 MATON_API_KEY 环境变量即可调用。
显著优点
- 托管 OAuth 简化集成:无需自行实现 Zoho OAuth 流程,Maton 提供连接管理面板(ctrl.maton.ai)和自动 token 刷新
- 完整功能覆盖:支持发送/接收/搜索/草稿/定时邮件、文件夹层级管理、标签系统、附件处理等企业级需求
- 多语言示例:提供 Python、JavaScript、Bash curl 等即拿即用的代码片段
- 企业级安全:全链路 HTTPS、无本地可执行代码、纯文档型架构从根本上消除注入风险
- 多连接管理:支持通过
Maton-Connection 头切换多个 Zoho 账户,适合多租户场景
潜在缺点与局限性
- 供应商锁定:依赖 Maton 网关服务,若服务中断或政策变更会影响可用性
- 功能代理延迟:API 请求需经 Maton 网关中转,可能引入额外网络延迟
- Scope 限制:部分高级操作(如特定标签管理)可能需要联系 Maton 支持开通额外 OAuth 权限
- 仅支持 Zoho Mail:不兼容 Gmail、Outlook 等其他邮件服务商,需配合 api-gateway skill 实现多平台支持
- 学习成本:需理解 Zoho Mail 特有的 accountId/folderId/messageId 三层资源模型
适合人群
- 需要自动化邮件工作流的企业开发者(CRM 集成、客服工单、营销邮件)
- 使用 Zoho 生态(Zoho CRM、Zoho Desk)的现有用户
- 希望避免自建 OAuth 基础设施的中小团队
- 多账户邮件管理需求的系统管理员
常规风险
- API Key 泄露风险:
MATON_API_KEY 是访问邮件数据的唯一凭证,需严格保管,避免硬编码
- 数据跨境传输:邮件内容经 Maton 网关处理,需确认符合组织数据主权要求
- 权限过度授权:OAuth 授权时应遵循最小权限原则,仅开通必要操作范围
- 服务可用性依赖:Maton 网关的稳定性直接影响业务连续性,建议实现重试和降级机制
Maton-Connection 头切换多个 Zoho 账户,适合多租户场景- 供应商锁定:依赖 Maton 网关服务,若服务中断或政策变更会影响可用性
- 功能代理延迟:API 请求需经 Maton 网关中转,可能引入额外网络延迟
- Scope 限制:部分高级操作(如特定标签管理)可能需要联系 Maton 支持开通额外 OAuth 权限
- 仅支持 Zoho Mail:不兼容 Gmail、Outlook 等其他邮件服务商,需配合 api-gateway skill 实现多平台支持
- 学习成本:需理解 Zoho Mail 特有的 accountId/folderId/messageId 三层资源模型
适合人群
- 需要自动化邮件工作流的企业开发者(CRM 集成、客服工单、营销邮件)
- 使用 Zoho 生态(Zoho CRM、Zoho Desk)的现有用户
- 希望避免自建 OAuth 基础设施的中小团队
- 多账户邮件管理需求的系统管理员
常规风险
- API Key 泄露风险:
MATON_API_KEY 是访问邮件数据的唯一凭证,需严格保管,避免硬编码
- 数据跨境传输:邮件内容经 Maton 网关处理,需确认符合组织数据主权要求
- 权限过度授权:OAuth 授权时应遵循最小权限原则,仅开通必要操作范围
- 服务可用性依赖:Maton 网关的稳定性直接影响业务连续性,建议实现重试和降级机制
- API Key 泄露风险:
MATON_API_KEY是访问邮件数据的唯一凭证,需严格保管,避免硬编码 - 数据跨境传输:邮件内容经 Maton 网关处理,需确认符合组织数据主权要求
- 权限过度授权:OAuth 授权时应遵循最小权限原则,仅开通必要操作范围
- 服务可用性依赖:Maton 网关的稳定性直接影响业务连续性,建议实现重试和降级机制
技能正文
name: zoho-mail
description: |
Zoho Mail API integration with managed OAuth. Send, receive, and manage emails, folders, and labels.
Use this skill when users want to send emails, read messages, manage folders, or work with email labels in Zoho Mail.
For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Requires network access and valid Maton API key.
metadata:
author: maton
version: "1.0"
clawdbot:
emoji: 🧠
homepage: "https://maton.ai"
requires:
env:
- MATON_API_KEY
Zoho Mail
Access the Zoho Mail API with managed OAuth authentication. Send, receive, search, and manage emails with full folder and label management.
Quick Start
# List all accounts
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-mail/api/accounts')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Base URL
https://gateway.maton.ai/zoho-mail/{native-api-path}
# List all accounts
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-mail/api/accounts')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
https://gateway.maton.ai/zoho-mail/{native-api-path}
Replace {native-api-path} with the actual Zoho Mail API endpoint path. The gateway proxies requests to mail.zoho.com and automatically injects your OAuth token.
Authentication
All requests require the Maton API key in the Authorization header:
Authorization: Bearer $MATON_API_KEY
Environment Variable: Set your API key as MATON_API_KEY:
export MATON_API_KEY="YOUR_API_KEY"
Getting Your API Key
- Sign in or create an account at maton.ai
- Go to maton.ai/settings
- Copy your API key
Connection Management
Manage your Zoho Mail OAuth connections at https://ctrl.maton.ai.
List Connections
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=zoho-mail&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Create Connection
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'zoho-mail'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=zoho-mail&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'zoho-mail'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Response:
{
"connection": {
"connection_id": "21fd90f9-5935-43cd-b6c8-bde9d915ca80",
"status": "ACTIVE",
"creation_time": "2025-12-08T07:20:53.488460Z",
"last_updated_time": "2026-01-31T20:03:32.593153Z",
"url": "https://connect.maton.ai/?session_token=...",
"app": "zoho-mail",
"metadata": {}
}
}
Open the returned url in a browser to complete OAuth authorization.
Delete Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Specifying Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If you have multiple Zoho Mail connections, specify which one to use with the Maton-Connection header:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-mail/api/accounts')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If omitted, the gateway uses the default (oldest) active connection.
API Reference
Account Operations
Get All Accounts
Retrieve all mail accounts for the authenticated user.
GET /zoho-mail/api/accounts
Example:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-mail/api/accounts')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Account Details
GET /zoho-mail/api/accounts/{accountId}
Folder Operations
List All Folders
GET /zoho-mail/api/accounts/{accountId}/folders
GET /zoho-mail/api/accounts/{accountId}
List All Folders
GET /zoho-mail/api/accounts/{accountId}/folders
Example:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-mail/api/accounts/{accountId}/folders')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Response:
{
"status": {
"code": 200,
"description": "success"
},
"data": [
{
"folderId": "1367000000000008014",
"folderName": "Inbox",
"folderType": "Inbox",
"path": "/Inbox",
"imapAccess": true,
"isArchived": 0,
"URI": "https://mail.zoho.com/api/accounts/1367000000000008002/folders/1367000000000008014"
},
{
"folderId": "1367000000000008016",
"folderName": "Drafts",
"folderType": "Drafts",
"path": "/Drafts",
"imapAccess": true,
"isArchived": 0
}
]
}
Create Folder
POST /zoho-mail/api/accounts/{accountId}/folders
Content-Type: application/json
{
"folderName": "My Custom Folder"
}
Rename Folder
PUT /zoho-mail/api/accounts/{accountId}/folders/{folderId}
Content-Type: application/json
{
"folderName": "Renamed Folder"
}
Delete Folder
DELETE /zoho-mail/api/accounts/{accountId}/folders/{folderId}
Label Operations
List Labels
GET /zoho-mail/api/accounts/{accountId}/labels
POST /zoho-mail/api/accounts/{accountId}/folders
Content-Type: application/json
{
"folderName": "My Custom Folder"
}
PUT /zoho-mail/api/accounts/{accountId}/folders/{folderId}
Content-Type: application/json
{
"folderName": "Renamed Folder"
}
Delete Folder
DELETE /zoho-mail/api/accounts/{accountId}/folders/{folderId}
Label Operations
List Labels
GET /zoho-mail/api/accounts/{accountId}/labels
DELETE /zoho-mail/api/accounts/{accountId}/folders/{folderId}
List Labels
GET /zoho-mail/api/accounts/{accountId}/labels
Example:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-mail/api/accounts/{accountId}/labels')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Create Label
POST /zoho-mail/api/accounts/{accountId}/labels
Content-Type: application/json
{
"labelName": "Important"
}
Update Label
PUT /zoho-mail/api/accounts/{accountId}/labels/{labelId}
Content-Type: application/json
{
"labelName": "Updated Label"
}
Delete Label
DELETE /zoho-mail/api/accounts/{accountId}/labels/{labelId}
Email Message Operations
List Emails in Folder
GET /zoho-mail/api/accounts/{accountId}/messages/view?folderId={folderId}
POST /zoho-mail/api/accounts/{accountId}/labels
Content-Type: application/json
{
"labelName": "Important"
}
PUT /zoho-mail/api/accounts/{accountId}/labels/{labelId}
Content-Type: application/json
{
"labelName": "Updated Label"
}
Delete Label
DELETE /zoho-mail/api/accounts/{accountId}/labels/{labelId}
Email Message Operations
List Emails in Folder
GET /zoho-mail/api/accounts/{accountId}/messages/view?folderId={folderId}
DELETE /zoho-mail/api/accounts/{accountId}/labels/{labelId}
List Emails in Folder
GET /zoho-mail/api/accounts/{accountId}/messages/view?folderId={folderId}
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
folderId |
long | Folder ID to list messages from |
limit |
integer | Number of messages to return (default: 50) |
start |
integer | Offset for pagination |
sortBy |
string | Sort field (e.g., date) |
sortOrder |
boolean | true for ascending, false for descending |
Example:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-mail/api/accounts/{accountId}/messages/view?folderId={folderId}&limit=10')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Search Emails
GET /zoho-mail/api/accounts/{accountId}/messages/search?searchKey={query}
GET /zoho-mail/api/accounts/{accountId}/messages/search?searchKey={query}
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
searchKey |
string | Search query |
limit |
integer | Number of results to return |
start |
integer | Offset for pagination |
Example:
python <<'EOF'
import urllib.request, os, json
import urllib.parse
query = urllib.parse.quote('from:sender@example.com')
req = urllib.request.Request(f'https://gateway.maton.ai/zoho-mail/api/accounts/{{accountId}}/messages/search?searchKey={query}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Email Content
GET /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/content
GET /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/content
Example:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/content')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Email Headers
GET /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/header
Get Email Metadata
GET /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/details
Get Original Message (MIME)
GET /zoho-mail/api/accounts/{accountId}/messages/{messageId}/originalmessage
Send Email
POST /zoho-mail/api/accounts/{accountId}/messages
Content-Type: application/json
{
"fromAddress": "sender@yourdomain.com",
"toAddress": "recipient@example.com",
"subject": "Email Subject",
"content": "Email body content",
"mailFormat": "html"
}
GET /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/header
GET /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/details
Get Original Message (MIME)
GET /zoho-mail/api/accounts/{accountId}/messages/{messageId}/originalmessage
Send Email
POST /zoho-mail/api/accounts/{accountId}/messages
Content-Type: application/json
{
"fromAddress": "sender@yourdomain.com",
"toAddress": "recipient@example.com",
"subject": "Email Subject",
"content": "Email body content",
"mailFormat": "html"
}
GET /zoho-mail/api/accounts/{accountId}/messages/{messageId}/originalmessage
POST /zoho-mail/api/accounts/{accountId}/messages
Content-Type: application/json
{
"fromAddress": "sender@yourdomain.com",
"toAddress": "recipient@example.com",
"subject": "Email Subject",
"content": "Email body content",
"mailFormat": "html"
}
Request Body Fields:
| Field | Type | Required | Description |
|---|---|---|---|
fromAddress |
string | Yes | Sender's email address |
toAddress |
string | Yes | Recipient's email address |
subject |
string | Yes | Email subject |
content |
string | Yes | Email body content |
ccAddress |
string | No | CC recipient |
bccAddress |
string | No | BCC recipient |
mailFormat |
string | No | html or plaintext (default: html) |
askReceipt |
string | No | yes or no for read receipt |
encoding |
string | No | Character encoding (default: UTF-8) |
Example - Send Email:
python <<'EOF'
import urllib.request, os, json
data = json.dumps({
"fromAddress": "sender@yourdomain.com",
"toAddress": "recipient@example.com",
"subject": "Hello from Zoho Mail API",
"content": "<h1>Hello!</h1><p>This is a test email.</p>",
"mailFormat": "html"
}).encode()
req = urllib.request.Request('https://gateway.maton.ai/zoho-mail/api/accounts/{accountId}/messages', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Scheduling Parameters (Optional):
| Field | Type | Description |
|---|---|---|
isSchedule |
boolean | Enable scheduling |
scheduleType |
integer | 1-5 for preset times; 6 for custom |
timeZone |
string | Required if scheduleType=6 (e.g., GMT 5:30) |
scheduleTime |
string | Required if scheduleType=6 (format: MM/DD/YYYY HH:MM:SS) |
Reply to Email
POST /zoho-mail/api/accounts/{accountId}/messages/{messageId}
Content-Type: application/json
{
"fromAddress": "sender@yourdomain.com",
"toAddress": "recipient@example.com",
"subject": "Re: Original Subject",
"content": "Reply content"
}
Save Draft
POST /zoho-mail/api/accounts/{accountId}/messages
Content-Type: application/json
{
"fromAddress": "sender@yourdomain.com",
"toAddress": "recipient@example.com",
"subject": "Draft Subject",
"content": "Draft content",
"mode": "draft"
}
Update Message (Mark as Read/Unread, Move, Flag)
PUT /zoho-mail/api/accounts/{accountId}/updatemessage
Content-Type: application/json
{
"messageId": ["messageId1", "messageId2"],
"folderId": "folderId",
"mode": "markAsRead"
}
POST /zoho-mail/api/accounts/{accountId}/messages/{messageId}
Content-Type: application/json
{
"fromAddress": "sender@yourdomain.com",
"toAddress": "recipient@example.com",
"subject": "Re: Original Subject",
"content": "Reply content"
}
POST /zoho-mail/api/accounts/{accountId}/messages
Content-Type: application/json
{
"fromAddress": "sender@yourdomain.com",
"toAddress": "recipient@example.com",
"subject": "Draft Subject",
"content": "Draft content",
"mode": "draft"
}
Update Message (Mark as Read/Unread, Move, Flag)
PUT /zoho-mail/api/accounts/{accountId}/updatemessage
Content-Type: application/json
{
"messageId": ["messageId1", "messageId2"],
"folderId": "folderId",
"mode": "markAsRead"
}
PUT /zoho-mail/api/accounts/{accountId}/updatemessage
Content-Type: application/json
{
"messageId": ["messageId1", "messageId2"],
"folderId": "folderId",
"mode": "markAsRead"
}
Mode Options:
markAsRead- Mark messages as readmarkAsUnread- Mark messages as unreadmoveMessage- Move messages (requiresdestfolderId)flag- Set flag (requiresflagid: 1-4)archive- Archive messagesunArchive- Unarchive messagesspam- Mark as spamnotSpam- Mark as not spam
Example - Mark as Read:
python <<'EOF'
import urllib.request, os, json
data = json.dumps({
"messageId": ["1234567890123456789"],
"folderId": "9876543210987654321",
"mode": "markAsRead"
}).encode()
req = urllib.request.Request('https://gateway.maton.ai/zoho-mail/api/accounts/{accountId}/updatemessage', data=data, method='PUT')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Delete Email
DELETE /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}
Attachment Operations
Upload Attachment
POST /zoho-mail/api/accounts/{accountId}/messages/attachments
Content-Type: multipart/form-data
Get Attachment Info
GET /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/attachmentinfo
Download Attachment
GET /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/attachments/{attachmentId}
Pagination
DELETE /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}
Upload Attachment
POST /zoho-mail/api/accounts/{accountId}/messages/attachments
Content-Type: multipart/form-data
GET /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/attachmentinfo
Download Attachment
GET /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/attachments/{attachmentId}
Pagination
GET /zoho-mail/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/attachments/{attachmentId}
Zoho Mail uses offset-based pagination:
GET /zoho-mail/api/accounts/{accountId}/messages/view?folderId={folderId}&start=0&limit=50
start: Offset index (default: 0)limit: Number of records to return (default: 50)
For subsequent pages, increment start by limit:
- Page 1:
start=0&limit=50 - Page 2:
start=50&limit=50 - Page 3:
start=100&limit=50
Code Examples
JavaScript
const response = await fetch(
'https://gateway.maton.ai/zoho-mail/api/accounts',
{
headers: {
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
}
}
);
const data = await response.json();
Python
import os
import requests
response = requests.get(
'https://gateway.maton.ai/zoho-mail/api/accounts',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}
)
data = response.json()
Notes
- Account IDs are required for most operations - first call
/api/accounts to get your account ID
- Message IDs and Folder IDs are numeric strings
- The
fromAddress must be associated with the authenticated account
- Default folders include: Inbox, Drafts, Templates, Snoozed, Sent, Spam, Trash, Outbox
- Supported encodings: Big5, EUC-JP, EUC-KR, GB2312, ISO-2022-JP, ISO-8859-1, KOI8-R, Shift_JIS, US-ASCII, UTF-8, WINDOWS-1251
- Some operations (labels, folder management, sending) require additional OAuth scopes. If you receive an
INVALID_OAUTHSCOPE error, contact Maton support at support@maton.ai with the specific operations/APIs you need and your use-case
- IMPORTANT: When using curl commands, use
curl -g when URLs contain brackets to disable glob parsing
- IMPORTANT: When piping curl output to
jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments
Error Handling
Status
Meaning
400
Missing Zoho Mail connection or invalid request
401
Invalid or missing Maton API key
429
Rate limited
4xx/5xx
Passthrough error from Zoho Mail API
Troubleshooting: API Key Issues
- Check that the
MATON_API_KEY environment variable is set:
echo $MATON_API_KEY
- Verify the API key is valid by listing connections:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Troubleshooting: Invalid App Name
- Ensure your URL path starts with
zoho-mail. For example:
- Correct:
https://gateway.maton.ai/zoho-mail/api/accounts
- Incorrect:
https://gateway.maton.ai/api/accounts
Resources
import os
import requests
response = requests.get(
'https://gateway.maton.ai/zoho-mail/api/accounts',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}
)
data = response.json()
- Account IDs are required for most operations - first call
/api/accountsto get your account ID - Message IDs and Folder IDs are numeric strings
- The
fromAddressmust be associated with the authenticated account - Default folders include: Inbox, Drafts, Templates, Snoozed, Sent, Spam, Trash, Outbox
- Supported encodings: Big5, EUC-JP, EUC-KR, GB2312, ISO-2022-JP, ISO-8859-1, KOI8-R, Shift_JIS, US-ASCII, UTF-8, WINDOWS-1251
- Some operations (labels, folder management, sending) require additional OAuth scopes. If you receive an
INVALID_OAUTHSCOPEerror, contact Maton support at support@maton.ai with the specific operations/APIs you need and your use-case - IMPORTANT: When using curl commands, use
curl -gwhen URLs contain brackets to disable glob parsing - IMPORTANT: When piping curl output to
jqor other commands, environment variables like$MATON_API_KEYmay not expand correctly in some shell environments
Error Handling
Status
Meaning
400
Missing Zoho Mail connection or invalid request
401
Invalid or missing Maton API key
429
Rate limited
4xx/5xx
Passthrough error from Zoho Mail API
Troubleshooting: API Key Issues
| Status | Meaning |
|---|---|
| 400 | Missing Zoho Mail connection or invalid request |
| 401 | Invalid or missing Maton API key |
| 429 | Rate limited |
| 4xx/5xx | Passthrough error from Zoho Mail API |
- Check that the
MATON_API_KEYenvironment variable is set:
echo $MATON_API_KEY
- Verify the API key is valid by listing connections:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Troubleshooting: Invalid App Name
zoho-mail. For example:https://gateway.maton.ai/zoho-mail/api/accountshttps://gateway.maton.ai/api/accounts正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。