Skip to content

Put Webchat Human Availability

PUT
/webchat/human-availability

Set the office hours that decide whether a visitor is offered a person.

enabled: true with no reachable interval is worse than off: the widget offers a handover nobody answers. The app refuses the unreachable shapes and this forwards its answer rather than inventing a second opinion.

Overlapping and zero-length windows are refused at THIS boundary, because the request model is the app’s own.

Authorizations

Parameters

Header Parameters

X-Target-Org-Id
Any of:
string

Request Body required

When a human is available to take a handed-off conversation.

THIS IS WHAT DECIDES WHETHER A VISITOR IS OFFERED A PERSON. Turning it on with no reachable interval is worse than leaving it off: the widget offers a handover nobody answers. The app refuses the unreachable shapes; this forwards its answer.

intervals and overrides use the app’s own window models, which reject a zero-length window and refuse overlapping ones - see the module docstring.

object
chat_bot_id
Any of:
string
enabled
boolean
intervals

Weekly windows: {day: 0-6, start: 'HH:MM', end: 'HH:MM'}.

Array<object>

A weekly recurring window. day is 0-6 with Monday = 0.

object
day
required
integer
<= 6
end
required
string
>= 5 characters <= 5 characters /^(([01]\d|2[0-3]):[0-5]\d|24:00)$/
start
required
string
>= 5 characters <= 5 characters /^([01]\d|2[0-3]):[0-5]\d$/
overrides

Date overrides: {date: 'YYYY-MM-DD', intervals: [...]}.

Array<object>

A single calendar date whose windows REPLACE that weekday’s windows.

An empty intervals list means closed all day — that is the whole point of an override, so it is not treated as “unset”. Window day values are ignored here (the date already fixes the day), and a client that sends one has it dropped by Pydantic’s default extra="ignore".

object
date
required
string
>= 10 characters <= 10 characters /^\d{4}-\d{2}-\d{2}$/
intervals
Array<object>
<= 10 items

One open window inside a single day, as wall-clock HH:MM.

end <= start means the window crosses midnight into the next day; "24:00" is a legal end only and means end-of-day.

Both fields pin an exact LENGTH as well as a pattern, because a container’s max_length bounds the element COUNT and never a nested string — the bound on the string itself has to live here.

The length pin is redundant against today’s engine and kept anyway: pydantic compiles this pattern with the Rust regex crate, whose $ matches only at the end of the haystack, so “09:00\n” is already rejected. Python’s re, which pydantic falls back to for patterns the Rust engine cannot compile, matches $ BEFORE a trailing newline and would let it through. Five characters cannot hold a newline either way, so the pin makes the guarantee engine-independent.

object
end
required
string
>= 5 characters <= 5 characters /^(([01]\d|2[0-3]):[0-5]\d|24:00)$/
start
required
string
>= 5 characters <= 5 characters /^([01]\d|2[0-3]):[0-5]\d$/
surface
Any of:
string
Allowed values: external internal
timezone

IANA zone the intervals are expressed in.

string
default: UTC >= 1 characters <= 64 characters

Responses

200

Successful Response

object
data
required

An open envelope for one webchat object.

Open because the widget’s config grows a field per product decision and a pinned schema would DROP it. Same choice the desk surface made.

object
key
additional properties
any
pagination
Any of:
object
has_next
required

Whether there are more pages

boolean
limit
required

Items per page

integer
next_cursor
Any of:
string
notes
Any of:
Array<string>
page
required

Current page number (1-indexed)

integer
total
required

Total number of items

integer
total_available
Any of:
integer
total_is_lower_bound
Any of:
boolean

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string