Skip to content

Send a client hours PDF on an order's chat

POST
/reports/client-hours/send
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/api/v1/reports/client-hours/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "balanceStyle": "simple", "clientId": "example", "endDate": "2026-04-15", "layout": "date", "message": "example", "orderId": "example", "projectId": "example", "scope": "full", "startDate": "2026-04-15" }'

Builds the client hours PDF for one order and posts it on that order’s chat with message, as the caller and always visible to the client, whose people are notified as for any shared order message. Sending again posts again. Requires the orders.edit permission, the order within the caller’s reach, and export access to the client’s report: Requires staff access to a client within the actor’s scope (clients.view_all or an assignment). Viewing needs reports.view or reports.export; exporting needs reports.export — the client’s Manager may always view and export regardless of report permissions. layout, scope and balanceStyle shape the PDF as in the export. A missing startDate or endDate follows the selected orders’ default report range: one order opens on its order type’s report range (by default, Hour block, Sprint, Tokens and Time & Materials from the order start to today, or to its end date once passed, and Subscription and Non billable on the current period); several orders that all run from their start open from the earliest start; no order or mixed types open on the current month. A date sent always wins, and the response’s startDate and endDate are the days covered.

Media typeapplication/json
object
balanceStyle
string
default: simple
Allowed values: simple detailed
clientId
required
string
>= 1 characters
endDate

Last day, YYYY-MM-DD in the workspace timezone.

string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
layout
string
default: date
Allowed values: date task tag
message
required

The message posted with the PDF, visible to the client.

string
>= 1 characters <= 5000 characters
orderId
required

The order whose chat receives the report.

string
>= 1 characters
projectId
string
>= 1 characters
scope
string
default: full
Allowed values: full summary detail
startDate

First day, YYYY-MM-DD in the workspace timezone.

string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/

The posted message and the PDF’s file name.

Media typeapplication/json
object
data
required
object
fileName
required
string
messageId
required
string
orderId
required
string

Example generated

{
"data": {
"fileName": "example",
"messageId": "example",
"orderId": "example"
}
}

Validation error. Parse failures include field paths and expectations.

Media typeapplication/json

Validation error with safe field paths and expected values; submitted values are never returned.

object
error
required
object
code
required

Stable machine-readable error code.

string
issues
Array<object>
object
expected
required
string
message
required
string
path
required
Array<string | number>
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Missing the orders.edit permission, or export access to the client’s report.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Order not found, out of reach, or without an hours report in the period.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Invalid report scope, or the PDF could not be stored.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.