Zoho Projects Skill
Use the Zoho Projects V3 REST API (base: https://projectsapi.zoho.com/api/v3) to manage projects, tasks, milestones, and time logs.
Authentication
Every request must include:
CODEBLOCK0
Access tokens expire hourly. If you get a 401, tell the user their token has expired and they need to refresh it using their refresh token (see Setup below). Store the refreshed token with:
CODEBLOCK1
Environment Variables
| Variable | Description |
|---|
| INLINECODE1 | OAuth2 access token from Zoho (expires hourly) |
| INLINECODE2 |
Your portal ID (get it from the List Portals call below) |
|
ZOHO_REFRESH_TOKEN | (optional) Stored refresh token for auto-renewal |
|
ZOHO_CLIENT_ID | (optional) OAuth client ID for token refresh |
|
ZOHO_CLIENT_SECRET | (optional) OAuth client secret for token refresh |
|
ZOHO_DC | (optional) Data center domain, e.g.
zoho.eu or
zoho.com (default:
zoho.com) |
Setup (First Time)
- 1. Go to https://api-console.zoho.com/ → Create a Self Client application
- Grant scopes: INLINECODE10
- Generate a grant token (duration: 10 minutes is fine for initial setup)
- Exchange it for access + refresh tokens:
curl -X POST "https://accounts.zoho.com/oauth/v2/token" \
-d "grant_type=authorization_code" \
-d "client_id=$ZOHO_CLIENT_ID" \
-d "client_secret=$ZOHO_CLIENT_SECRET" \
-d "redirect_uri=https://localhost" \
-d "code=YOUR_GRANT_TOKEN"
- 5. Save the
access_token as ZOHO_ACCESS_TOKEN and refresh_token as INLINECODE14 - Get your portal ID by calling List Portals below, then set INLINECODE15
Refreshing an Expired Token
If you get a 401 Unauthorized error, refresh the token:
curl -X POST "https://accounts.${ZOHO_DC:-zoho.com}/oauth/v2/token" \
-d "grant_type=refresh_token" \
-d "client_id=$ZOHO_CLIENT_ID" \
-d "client_secret=$ZOHO_CLIENT_SECRET" \
-d "refresh_token=$ZOHO_REFRESH_TOKEN"
Parse the
access_token from the JSON response and update
ZOHO_ACCESS_TOKEN.
API Reference
🏢 Portals
List Portals (use this to find your ZOHOPORTALID)
curl -s "https://projectsapi.zoho.com/api/v3/portals" \
-H "Authorization: Zoho-oauthtoken $ZOHO_ACCESS_TOKEN"
📁 Projects
List all projects
CODEBLOCK5
Get a specific project
CODEBLOCK6
Create a project
CODEBLOCK7
Update a project (PATCH updates only specified fields)
curl -s -X PATCH "https://projectsapi.zoho.com/api/v3/portal/$ZOHO_PORTAL_ID/projects/$PROJECT_ID" \
-H "Authorization: Zoho-oauthtoken $ZOHO_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Updated Name", "status": "active"}'
✅ Tasks
Get my tasks (across all projects)
curl -s "https://projectsapi.zoho.com/api/v3/portal/$ZOHO_PORTAL_ID/mytasks" \
-H "Authorization: Zoho-oauthtoken $ZOHO_ACCESS_TOKEN"
Optional query params:
?status=open |
status=closed | INLINECODE20
List tasks in a project
curl -s "https://projectsapi.zoho.com/api/v3/portal/$ZOHO_PORTAL_ID/projects/$PROJECT_ID/tasks" \
-H "Authorization: Zoho-oauthtoken $ZOHO_ACCESS_TOKEN"
Optional: INLINECODE21
Get task details
CODEBLOCK11
Create a task
curl -s -X POST "https://projectsapi.zoho.com/api/v3/portal/$ZOHO_PORTAL_ID/projects/$PROJECT_ID/tasks" \
-H "Authorization: Zoho-oauthtoken $ZOHO_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Task name",
"description": "Task details",
"due_date": "2026-04-15T00:00:00Z",
"priority": "high"
}'
Priority values:
none,
low,
medium, INLINECODE25
Update / complete a task
curl -s -X PATCH "https://projectsapi.zoho.com/api/v3/portal/$ZOHO_PORTAL_ID/projects/$PROJECT_ID/tasks/$TASK_ID" \
-H "Authorization: Zoho-oauthtoken $ZOHO_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status": "closed"}'
Use
"status": "open" to reopen a task.
Delete a task
CODEBLOCK14
Add a comment to a task
curl -s -X POST "https://projectsapi.zoho.com/api/v3/portal/$ZOHO_PORTAL_ID/projects/$PROJECT_ID/tasks/$TASK_ID/comments" \
-H "Authorization: Zoho-oauthtoken $ZOHO_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"content": "Your comment here"}'
🎯 Milestones
List milestones in a project
CODEBLOCK16
Create a milestone
curl -s -X POST "https://projectsapi.zoho.com/api/v3/portal/$ZOHO_PORTAL_ID/projects/$PROJECT_ID/milestones" \
-H "Authorization: Zoho-oauthtoken $ZOHO_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Milestone name",
"end_date": "2026-05-01T00:00:00Z",
"flag": "internal"
}'
⏱ Time Logs
Log time on a task
CODEBLOCK18
Get time logs for a project
curl -s "https://projectsapi.zoho.com/api/v3/portal/$ZOHO_PORTAL_ID/projects/$PROJECT_ID/logs" \
-H "Authorization: Zoho-oauthtoken $ZOHO_ACCESS_TOKEN"
Tips
- - All dates must be ISO 8601 format: INLINECODE27
- Rate limit: 100 requests per 2 minutes. If you hit 429, wait 30 seconds before retrying.
- Use
| python3 -m json.tool after curl commands to pretty-print JSON responses. - For EU/AU/IN/JP Zoho accounts, set
ZOHO_DC to the correct domain (e.g., zoho.eu) and use projectsapi.zoho.eu as the API base URL instead. - When listing projects or tasks, extract the
id or id_string field to use in subsequent calls. - If the user asks to "show all open tasks", call the mytasks endpoint with
?status=open and format the results as a readable list. - When creating tasks for sarvahealth.ai or Katprotech work, apply appropriate project IDs stored in memory.
Zoho Projects 技能
使用 Zoho Projects V3 REST API(基础地址:https://projectsapi.zoho.com/api/v3)来管理项目、任务、里程碑和工时记录。
身份验证
每个请求必须包含:
Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN
访问令牌每小时过期。如果收到 401 错误,请告知用户其令牌已过期,需要使用刷新令牌进行刷新(参见下面的设置部分)。使用以下命令存储刷新后的令牌:
bash
openclaw config set skills.entries.zoho-projects.apiKey NEW_TOKEN
环境变量
| 变量 | 描述 |
|---|
| ZOHOACCESSTOKEN | 来自 Zoho 的 OAuth2 访问令牌(每小时过期) |
| ZOHOPORTALID |
您的门户 ID(通过下面的列出门户调用获取) |
| ZOHO
REFRESHTOKEN | (可选)用于自动续期的存储刷新令牌 |
| ZOHO
CLIENTID | (可选)用于令牌刷新的 OAuth 客户端 ID |
| ZOHO
CLIENTSECRET | (可选)用于令牌刷新的 OAuth 客户端密钥 |
| ZOHO_DC | (可选)数据中心域名,例如 zoho.eu 或 zoho.com(默认:zoho.com) |
设置(首次使用)
- 1. 访问 https://api-console.zoho.com/ → 创建一个自客户端应用程序
- 授权范围:ZohoProjects.portals.READ,ZohoProjects.projects.ALL,ZohoProjects.tasks.ALL,ZohoProjects.milestones.ALL,ZohoProjects.timesheets.ALL,ZohoProjects.bugs.ALL
- 生成授权令牌(初始设置时,10 分钟有效期即可)
- 将其交换为访问令牌和刷新令牌:
bash
curl -X POST https://accounts.zoho.com/oauth/v2/token \
-d grant
type=authorizationcode \
-d client
id=$ZOHOCLIENT_ID \
-d client
secret=$ZOHOCLIENT_SECRET \
-d redirect_uri=https://localhost \
-d code=YOUR
GRANTTOKEN
- 5. 将 accesstoken 保存为 ZOHOACCESSTOKEN,将 refreshtoken 保存为 ZOHOREFRESHTOKEN
- 通过下面的列出门户调用获取您的门户 ID,然后设置 ZOHOPORTALID
刷新过期令牌
如果收到 401 未授权错误,请刷新令牌:
bash
curl -X POST https://accounts.${ZOHO_DC:-zoho.com}/oauth/v2/token \
-d granttype=refreshtoken \
-d clientid=$ZOHOCLIENT_ID \
-d clientsecret=$ZOHOCLIENT_SECRET \
-d refreshtoken=$ZOHOREFRESH_TOKEN
从 JSON 响应中解析 accesstoken 并更新 ZOHOACCESS_TOKEN。
API 参考
🏢 门户
列出门户(使用此接口查找您的 ZOHOPORTALID)
bash
curl -s https://projectsapi.zoho.com/api/v3/portals \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN
📁 项目
列出所有项目
bash
curl -s https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/projects \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN
获取特定项目
bash
curl -s https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/projects/$PROJECT_ID \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN
创建项目
bash
curl -s -X POST https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/projects \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN \
-H Content-Type: application/json \
-d {
name: 项目名称,
description: 可选描述,
start_date: 2026-03-24T00:00:00Z,
end_date: 2026-06-30T00:00:00Z
}
更新项目(PATCH 仅更新指定字段)
bash
curl -s -X PATCH https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/projects/$PROJECT_ID \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN \
-H Content-Type: application/json \
-d {name: 更新后的名称, status: active}
✅ 任务
获取我的任务(跨所有项目)
bash
curl -s https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/mytasks \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN
可选查询参数:?status=open | status=closed | due_date=2026-03-24
列出项目中的任务
bash
curl -s https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/projects/$PROJECT_ID/tasks \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN
可选:?status=open&sortcolumn=duedate&sort_order=asc
获取任务详情
bash
curl -s https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/projects/$PROJECTID/tasks/$TASKID \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN
创建任务
bash
curl -s -X POST https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/projects/$PROJECT_ID/tasks \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN \
-H Content-Type: application/json \
-d {
name: 任务名称,
description: 任务详情,
due_date: 2026-04-15T00:00:00Z,
priority: high
}
优先级值:none、low、medium、high
更新/完成任务
bash
curl -s -X PATCH https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/projects/$PROJECTID/tasks/$TASKID \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN \
-H Content-Type: application/json \
-d {status: closed}
使用 status: open 重新打开任务。
删除任务
bash
curl -s -X DELETE https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/projects/$PROJECTID/tasks/$TASKID \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN
给任务添加评论
bash
curl -s -X POST https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/projects/$PROJECTID/tasks/$TASKID/comments \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN \
-H Content-Type: application/json \
-d {content: 您的评论内容}
🎯 里程碑
列出项目中的里程碑
bash
curl -s https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/projects/$PROJECT_ID/milestones \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN
创建里程碑
bash
curl -s -X POST https://projectsapi.zoho.com/api/v3/portal/$ZOHOPORTALID/projects/$PROJECT_ID/milestones \
-H Authorization: Zoho-oauthtoken $ZOHOACCESSTOKEN \
-H Content-Type: application/json \
-d {
name: 里程碑名称,
end_date: 2026-05-01T00:00:00Z,
flag: internal
}
⏱ 工时记录
记录任务工时