Skip to content

Update business hours

PATCH
/tickets/messaging/business-hours
Code sample: Shell / cURL
curl --request PATCH \
--url https://example.com/api/v1/tickets/messaging/business-hours \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "enabled": true, "rows": [ { "days": [ 1 ], "end": "example", "start": "example" } ] }'

Replaces the workspace’s business-hours rows, used to measure SLAs against working time and to decide when a ticket arrived off-hours for the auto-reply. Each row selects one or more days and a start and end time; times are always in the workspace timezone, which this endpoint does not accept. Requires the settings.manage permission.

Media typeapplication/json
object
enabled
required
boolean
rows
required
Array<object>
<= 50 items
object
days
required
Array<integer>
>= 1 items
end
required
string
/^([01]\d|2[0-3]):[0-5]\d$/
start
required
string
/^([01]\d|2[0-3]):[0-5]\d$/

Example generated

{
"enabled": true,
"rows": [
{
"days": [
1
],
"end": "example",
"start": "example"
}
]
}

The updated business-hours schedule, with the workspace timezone.

Media typeapplication/json
object
data
required

A workspace’s business-hours schedule.

object
enabled
required

Whether business hours are enforced (SLA measurement and the auto-reply gate).

boolean
rows
required

Open windows. A day’s business time is the union of every row that covers it.

Array<object>
object
days
required

Days this row covers, 0 = Sunday … 6 = Saturday. A day may appear in several rows.

Array<integer>
end
required

HH:MM, 24-hour, in the workspace timezone; after start.

string
start
required

HH:MM, 24-hour, in the workspace timezone.

string
timezone
required

Read-only. The workspace timezone every row is expressed in; change it in the workspace preferences.

string

Example generated

{
"data": {
"enabled": true,
"rows": [
{
"days": [
1
],
"end": "example",
"start": "example"
}
],
"timezone": "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"
}
}

Forbidden.

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.