Scoro Integration
Full Scoro API v2 integration for OpenClaw. Provides task management, time tracking, hours calculation, utilization reports, team dashboards, and billable status corrections.
Setup
- 1. Get your Scoro API key from Settings → External connections → API in your Scoro account.
- Set your company URL (e.g.
https://yourcompany.scoro.com/api/v2). - Add both to your OpenClaw config:
CODEBLOCK0
- 4. Add
"scoro" to your agent's skills list in openclaw.json.
Standard Prompts
Users can trigger these capabilities with natural language:
Task Management
- -
fetch my scoro tasks / INLINECODE4 - INLINECODE5
- INLINECODE6
Hours & Time Entries
- -
show my hours this week / INLINECODE8 - INLINECODE9 / INLINECODE10
- INLINECODE11
- INLINECODE12
Team & Manager Reports
- -
show team status / INLINECODE14 - INLINECODE15
Utilization Reporting
- - INLINECODE16
- INLINECODE17
Billable Corrections
- - INLINECODE18
- INLINECODE19
- INLINECODE20
Environment Variables
- -
SCORO_COMPANY_URL — full base URL (e.g. https://yourcompany.scoro.com/api/v2) - INLINECODE23 — company API key (starts with
ScoroAPI_)
Both must be set in openclaw.json under env.vars. They are available as shell environment variables. Do NOT use .env files.
API Basics
All Scoro API v2 requests are POST. Every request body must include apiKey and company_account_id.
The company_account_id is the subdomain from your Scoro URL. For https://yourcompany.scoro.com, it is yourcompany.
Example Request (curl)
CODEBLOCK1
Example Request (PowerShell / Windows)
CODEBLOCK2
Key Endpoints
All endpoints: POST $SCORO_COMPANY_URL/{module}/{action}
| Endpoint | Purpose |
|---|
| INLINECODE34 | Fetch tasks with filters |
| INLINECODE35 |
View single task details |
|
timeEntries/list | Fetch time entries (with date, user, billable filters) |
|
timeEntries/modify/ID | Update a time entry (e.g. fix billable status) |
|
users/list | Fetch all users (includes reporting manager info) |
|
projects/list | Fetch projects |
|
contacts/list | Fetch contacts |
Filtering
Tasks
CODEBLOCK3
- -
responsible_person_ids — array of assigned user IDs - INLINECODE42 — INLINECODE43
- INLINECODE44 — INLINECODE45
Time Entries
CRITICAL: The date filter field is time_entry_date with from/to keys. NOT start_date/end_date.
CODEBLOCK4
- -
user_ids — array of user IDs (not a single value)
Users
No specific filter needed. Returns all active users.
Response Fields
Task Fields
- -
event_id — unique task ID - INLINECODE53 — task name/title
- INLINECODE54 — deadline (ISO datetime)
- INLINECODE55 — 0 or 1
- INLINECODE56 — project/category name
- INLINECODE57 — assigned user ID
- INLINECODE58 — task description
Time Entry Fields
- -
time_entry_id — unique ID - INLINECODE60 — the user who logged it
- INLINECODE61 — format "HH:MM:SS" (e.g. "01:30:00" = 1.5h)
- INLINECODE62 — task/event name
- INLINECODE63 — "billable", "non_billable", or "custom"
- INLINECODE64 — "YYYY-MM-DD"
- INLINECODE65 — the task/event this entry is for
- INLINECODE66 — 0 or 1
User Fields
- -
id — unique user ID - INLINECODE68 — display name
- INLINECODE69 — email address
- INLINECODE70 — job title
Duration Parsing
Format is "HH:MM:SS". Convert to decimal hours:
hours + minutes/60 + seconds/3600.
Pagination — CRITICAL
Scoro caps page size at 25 items regardless of per_page setting.
You MUST paginate through ALL pages for any list operation:
CODEBLOCK5
Important: Do NOT use data.length < per_page as a stop condition — the API returns a max of 25 items per page even if you request 100. Stop when a page returns 0 results.
Calculating Hours
- 1. Determine date range (default: this week Monday to today)
- Fetch all time entries for the date range and user(s), paginating all pages
- Calculate:
total_hours = sum(duration)
billable_hours = sum(duration where billable_time_type == "billable")
non_billable_hours = sum(duration where billable_time_type == "non_billable")
billable_ratio = (billable_hours / total_hours) * 100
- 4. Present with 2 decimal places
Team Reports
Teams are organized by direct manager (reporting lines).
Workflow for Team Status
- 1. Resolve user IDs for all team members (by email, from
users/list, all pages) - Fetch today's time entries for all team members at once
- Per member: total hours, billable split, latest task name
- Calculate team totals and billable ratio
Billable Status Correction
Detection
- 1. Retrieve time entries for the period
- Retrieve task billing type for each task
- Flag mismatches: task is billable but time entry is non_billable
Correction
CODEBLOCK7
Always confirm with the user before modifying entries.
Rate Limits
- - 2-second rate limit window
- Add 1-second delay between paginated API calls
- On 429 errors, wait and retry
Response Format
CODEBLOCK8
All Available Modules
INLINECODE75 , timeEntries, users, projects, contacts, invoices, quotes, orders, bills, expenses, products, calendarEvents, bookings, purchaseOrders, tags, customModules, vatCodes, INLINECODE92
Each module supports: list, view, modify, delete.
Use modify and delete only with explicit user permission.
Notes
- - All requests are POST (even "list" and "view")
- Always include
apiKey and company_account_id in the JSON body - Use
detailed_response: true for full field data in list requests - Duration format: "HH:MM:SS" → convert to decimal hours for reporting
- The
lang parameter is optional (defaults to site language) - On Windows, prefer PowerShell
Invoke-RestMethod over curl
Scoro 集成
为 OpenClaw 提供完整的 Scoro API v2 集成。支持任务管理、时间追踪、工时计算、利用率报告、团队仪表盘以及可计费状态修正。
设置
- 1. 在 Scoro 账户中,通过 设置 → 外部连接 → API 获取 Scoro API 密钥。
- 设置公司 URL(例如 https://yourcompany.scoro.com/api/v2)。
- 将两者添加到 OpenClaw 配置中:
json
{
env: {
vars: {
SCOROAPIKEY: ScoroAPIyourkey_here,
SCOROCOMPANYURL: https://yourcompany.scoro.com/api/v2
}
}
}
- 4. 在 openclaw.json 中,将 scoro 添加到代理的技能列表中。
标准提示词
用户可以通过自然语言触发以下功能:
任务管理
- - 获取我的 Scoro 任务 / 显示我本周的任务
- 获取 <用户邮箱或姓名> 的任务
- 显示逾期任务
工时与时间条目
- - 显示我本周的工时 / 我记录了多少小时?
- 计算我的可计费工时 / 显示可计费与不可计费工时
- 向我发送一份可计费与不可计费工时的报告
- 显示 <用户> 从 <日期> 到 <日期> 的时间条目
团队与经理报告
利用率报告
- - 生成每周利用率报告
- 显示 <用户> 的可计费比例
可计费修正
- - 查找不正确的可计费条目
- 修正条目 的可计费状态
- 将任务 X 的所有记录调整为可计费
环境变量
- - SCOROCOMPANYURL — 完整的基准 URL(例如 https://yourcompany.scoro.com/api/v2)
- SCOROAPIKEY — 公司 API 密钥(以 ScoroAPI_ 开头)
两者都必须在 openclaw.json 的 env.vars 下设置。它们可作为 shell 环境变量使用。不要使用 .env 文件。
API 基础
所有 Scoro API v2 请求均为 POST。 每个请求体必须包含 apiKey 和 companyaccountid。
companyaccountid 是 Scoro URL 中的子域名。对于 https://yourcompany.scoro.com,它是 yourcompany。
示例请求(curl)
bash
curl -X POST $SCOROCOMPANYURL/timeEntries/list \
-H Content-Type: application/json \
-d {
apiKey: $SCOROAPIKEY,
companyaccountid: yourcompany,
filter: {
timeentrydate: {
from: 2026-03-10,
to: 2026-03-16
},
user_ids: [123]
},
per_page: 100,
page: 1,
detailed_response: true
}
示例请求(PowerShell / Windows)
powershell
$body = @{
apiKey = $env:SCOROAPIKEY
companyaccountid = yourcompany
filter = @{
timeentrydate = @{ from = 2026-03-10; to = 2026-03-16 }
user_ids = @(123)
}
per_page = 100
page = 1
detailed_response = $true
} | ConvertTo-Json -Depth 10
$response = Invoke-RestMethod -Method Post
-Uri $env:SCOROCOMPANYURL/timeEntries/list
-ContentType application/json -Body $body
关键端点
所有端点:POST $SCOROCOMPANYURL/{module}/{action}
| 端点 | 用途 |
|---|
| tasks/list | 使用筛选条件获取任务 |
| tasks/view/ID |
查看单个任务详情 |
| timeEntries/list | 获取时间条目(支持日期、用户、可计费筛选) |
| timeEntries/modify/ID | 更新时间条目(例如修正可计费状态) |
| users/list | 获取所有用户(包含汇报经理信息) |
| projects/list | 获取项目 |
| contacts/list | 获取联系人 |
筛选
任务
json
{
filter: {
responsiblepersonids: [123],
deadline: { from: 2026-03-16, to: 2026-03-22 },
status: in_progress
}
}
- - responsiblepersonids — 分配的用户 ID 数组
- deadline — {from: YYYY-MM-DD, to: YYYY-MM-DD}
- modified_date — {from: YYYY-MM-DD, to: YYYY-MM-DD}
时间条目
关键:日期筛选字段为 timeentrydate,包含 from/to 键。不是 startdate/enddate。
json
{
filter: {
timeentrydate: { from: 2026-03-10, to: 2026-03-16 },
user_ids: [123]
}
}
- - user_ids — 数组形式的用户 ID(不是单个值)
用户
无需特定筛选。返回所有活跃用户。
响应字段
任务字段
- - eventid — 唯一任务 ID
- eventname — 任务名称/标题
- datetimedue — 截止日期(ISO 日期时间)
- iscompleted — 0 或 1
- activitytype — 项目/类别名称
- responsibleperson_id — 分配的用户 ID
- description — 任务描述
时间条目字段
- - timeentryid — 唯一 ID
- userid — 记录该条目的用户
- duration — 格式 HH:MM:SS(例如 01:30:00 = 1.5 小时)
- title — 任务/事件名称
- billabletimetype — billable、nonbillable 或 custom
- timeentrydate — YYYY-MM-DD
- eventid — 该条目对应的任务/事件
- isbillable — 0 或 1
用户字段
- - id — 唯一用户 ID
- full_name — 显示名称
- email — 电子邮件地址
- position — 职位
时长解析
格式为 HH:MM:SS。转换为十进制小时:小时 + 分钟/60 + 秒/3600。
分页 — 关键
无论 per_page 设置如何,Scoro 每页最多返回 25 个项目。
对于任何列表操作,您必须遍历所有页面:
page = 1
all_results = []
循环:
response = POST .../endpoint { per_page: 100, page: page }
如果 length(response.data) == 0:跳出循环
all_results += response.data
page += 1
等待 1 秒(速率限制)
重要: 不要使用 data.length < per_page 作为停止条件——即使您请求 100 个项目,API 每页最多返回 25 个。当页面返回 0 个结果时停止。
计算工时
- 1. 确定日期范围(默认:本周周一至今天)
- 获取日期范围和用户的所有时间条目,遍历所有页面
- 计算:
total_hours = sum(duration)
billablehours = sum(duration where billabletime_type == billable)
nonbillablehours = sum(duration where billabletimetype == non_billable)
billableratio = (billablehours / total_hours) * 100
- 4. 保留两位小数呈现
团队报告
团队按直接经理(汇报关系)组织。
团队状态工作流程
- 1. 解析所有团队成员的用户 ID(通过邮箱,从 users/list 获取所有页面)
- 一次性获取所有团队成员今天的时间条目
- 每位成员:总工时、可计费拆分、最新任务名称
- 计算团队总计和可计费比例
可计费状态修正
检测
- 1. 获取时间段内的时间条目
- 获取每个任务的任务计费类型
- 标记不匹配