agency-time

POST /v1/agency/time/entries

Log time.

所有 agency-time 端点

身份验证

请将 API 密钥作为 bearer 令牌发送。该密钥必须具有 agency.time.log 权限;缺少该权限的密钥将被拒绝并返回 403 状态码,而非 404。

此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。

免费试用

将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。

curl -X POST https://api.zinndigital.com/v1/agency/time/entries \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "project_id": <string>, "work_date": <string>, "minutes": <integer> }'

已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点

详细信息

`minutes` is an integer, 1..1440. Requires `agency.time.log` for your own time, or `agency.time.manage` to pass `user_id` and log on somebody else's behalf. If this client's billing schedule is *"invoice straight away"*, logging arms it and starts the billing workflow immediately — the invoice is raised in seconds rather than at the next sweep, without the invoicing call ever sitting in this request.

请求正文

名称类型必填内容简介
project_idstring
task_idstring
work_datestring
minutesinteger
descriptionstring
billableboolean
user_idstringLog on somebody else's behalf. Requires `agency.time.manage`; without it a caller may only log their own time.

响应

名称类型必填内容简介
idstring
user_idstring
project_idstring
project_namestring
task_idstring
task_namestring
client_idstring
work_datestring
minutesinteger⛔ An INTEGER of minutes. There is no `hours` field on this API: an hours-as-float duration re-enters the money through the rate and no rounding point can recover it.
duration_labelstringPresentational only — never multiplied by anything.
descriptionstring
billableboolean
billing_run_idstringThe run that invoiced this entry. `null` means it is still outstanding.
billed_rate_minor_per_hourinteger
billed_amount_minorintegerWhat was actually charged, frozen at billing time so the document can be re-derived years later even if every rate card has since changed.
billed_currencystring
billed_under_fixed_pricebooleanTRUE when these minutes were rolled into a task's FIXED price rather than charged by the hour. `billed_amount_minor` is then 0 and that zero is correct — read this flag, not the…
rate_minor_per_hourintegerThe rate that WOULD apply, resolved against this entry's own `work_date`, for an entry not yet billed. ⛔ `null` means **unpriced**, not free: work with no rate card is never inv…
rate_scopestring<task, project, client, org>Which rate card won, so a surprising invoice can be explained.
rate_kindstring<hourly, fixed>
created_atstring

此端点可能返回的错误

401 · 403 · 422