curl --request PUT \
--url https://api.goyappr.com/call-windows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inbound_enabled": true,
"outbound_enabled": true,
"closed_message": "<string>",
"timezone": "Asia/Jerusalem",
"windows": [
{
"day_of_week": 3,
"start_time": "09:00",
"end_time": "19:00"
}
],
"expected_updated_at": "2026-09-22T11:30:00.000Z"
}
'import requests
url = "https://api.goyappr.com/call-windows"
payload = {
"inbound_enabled": True,
"outbound_enabled": True,
"closed_message": "<string>",
"timezone": "Asia/Jerusalem",
"windows": [
{
"day_of_week": 3,
"start_time": "09:00",
"end_time": "19:00"
}
],
"expected_updated_at": "2026-09-22T11:30:00.000Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inbound_enabled: true,
outbound_enabled: true,
closed_message: '<string>',
timezone: 'Asia/Jerusalem',
windows: [{day_of_week: 3, start_time: '09:00', end_time: '19:00'}],
expected_updated_at: '2026-09-22T11:30:00.000Z'
})
};
fetch('https://api.goyappr.com/call-windows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goyappr.com/call-windows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'inbound_enabled' => true,
'outbound_enabled' => true,
'closed_message' => '<string>',
'timezone' => 'Asia/Jerusalem',
'windows' => [
[
'day_of_week' => 3,
'start_time' => '09:00',
'end_time' => '19:00'
]
],
'expected_updated_at' => '2026-09-22T11:30:00.000Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/call-windows"
payload := strings.NewReader("{\n \"inbound_enabled\": true,\n \"outbound_enabled\": true,\n \"closed_message\": \"<string>\",\n \"timezone\": \"Asia/Jerusalem\",\n \"windows\": [\n {\n \"day_of_week\": 3,\n \"start_time\": \"09:00\",\n \"end_time\": \"19:00\"\n }\n ],\n \"expected_updated_at\": \"2026-09-22T11:30:00.000Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.goyappr.com/call-windows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inbound_enabled\": true,\n \"outbound_enabled\": true,\n \"closed_message\": \"<string>\",\n \"timezone\": \"Asia/Jerusalem\",\n \"windows\": [\n {\n \"day_of_week\": 3,\n \"start_time\": \"09:00\",\n \"end_time\": \"19:00\"\n }\n ],\n \"expected_updated_at\": \"2026-09-22T11:30:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/call-windows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inbound_enabled\": true,\n \"outbound_enabled\": true,\n \"closed_message\": \"<string>\",\n \"timezone\": \"Asia/Jerusalem\",\n \"windows\": [\n {\n \"day_of_week\": 3,\n \"start_time\": \"09:00\",\n \"end_time\": \"19:00\"\n }\n ],\n \"expected_updated_at\": \"2026-09-22T11:30:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"timezone": "Asia/Jerusalem",
"timezone_set": true,
"inbound_enabled": true,
"outbound_enabled": true,
"closed_message": "You've reached us outside our hours. We're here Sunday to Thursday, nine to seven.",
"updated_at": "2026-09-22T11:30:00.000Z",
"windows": [
{
"day_of_week": 3,
"start_time": "09:00",
"end_time": "19:00"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}Update call time windows
Atomically replaces the call window configuration. Send any combination
of inbound_enabled, outbound_enabled, closed_message, timezone and
windows. Omitting windows leaves the existing schedule unchanged;
including it (even as an empty array) overwrites the whole schedule.
timezone sets the workspace’s clock, which the hours, extraction dates,
campaign suggestions and consumption days are all read on.
Window rules:
day_of_weekis 0–6 (0=Sunday … 6=Saturday).start_timeandend_timeareHH:MM(24h, workspace timezone).start_timemust be earlier thanend_time(no overnight wrap-around — use two rows on consecutive days instead).- Multiple windows per day are allowed but must not overlap.
Requires the call_windows:manage scope. This one setting takes every agent in
the workspace on or off the phone, so a key minted for one agent’s management
cannot change it. Reading the hours needs no scope. Keys issued before this
scope existed do not hold it: Settings → API keys lists the scopes added since
a key was created and adds them to that key in one press, so the key an
integration already uses keeps working.
curl --request PUT \
--url https://api.goyappr.com/call-windows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inbound_enabled": true,
"outbound_enabled": true,
"closed_message": "<string>",
"timezone": "Asia/Jerusalem",
"windows": [
{
"day_of_week": 3,
"start_time": "09:00",
"end_time": "19:00"
}
],
"expected_updated_at": "2026-09-22T11:30:00.000Z"
}
'import requests
url = "https://api.goyappr.com/call-windows"
payload = {
"inbound_enabled": True,
"outbound_enabled": True,
"closed_message": "<string>",
"timezone": "Asia/Jerusalem",
"windows": [
{
"day_of_week": 3,
"start_time": "09:00",
"end_time": "19:00"
}
],
"expected_updated_at": "2026-09-22T11:30:00.000Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inbound_enabled: true,
outbound_enabled: true,
closed_message: '<string>',
timezone: 'Asia/Jerusalem',
windows: [{day_of_week: 3, start_time: '09:00', end_time: '19:00'}],
expected_updated_at: '2026-09-22T11:30:00.000Z'
})
};
fetch('https://api.goyappr.com/call-windows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goyappr.com/call-windows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'inbound_enabled' => true,
'outbound_enabled' => true,
'closed_message' => '<string>',
'timezone' => 'Asia/Jerusalem',
'windows' => [
[
'day_of_week' => 3,
'start_time' => '09:00',
'end_time' => '19:00'
]
],
'expected_updated_at' => '2026-09-22T11:30:00.000Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/call-windows"
payload := strings.NewReader("{\n \"inbound_enabled\": true,\n \"outbound_enabled\": true,\n \"closed_message\": \"<string>\",\n \"timezone\": \"Asia/Jerusalem\",\n \"windows\": [\n {\n \"day_of_week\": 3,\n \"start_time\": \"09:00\",\n \"end_time\": \"19:00\"\n }\n ],\n \"expected_updated_at\": \"2026-09-22T11:30:00.000Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.goyappr.com/call-windows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inbound_enabled\": true,\n \"outbound_enabled\": true,\n \"closed_message\": \"<string>\",\n \"timezone\": \"Asia/Jerusalem\",\n \"windows\": [\n {\n \"day_of_week\": 3,\n \"start_time\": \"09:00\",\n \"end_time\": \"19:00\"\n }\n ],\n \"expected_updated_at\": \"2026-09-22T11:30:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/call-windows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inbound_enabled\": true,\n \"outbound_enabled\": true,\n \"closed_message\": \"<string>\",\n \"timezone\": \"Asia/Jerusalem\",\n \"windows\": [\n {\n \"day_of_week\": 3,\n \"start_time\": \"09:00\",\n \"end_time\": \"19:00\"\n }\n ],\n \"expected_updated_at\": \"2026-09-22T11:30:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"timezone": "Asia/Jerusalem",
"timezone_set": true,
"inbound_enabled": true,
"outbound_enabled": true,
"closed_message": "You've reached us outside our hours. We're here Sunday to Thursday, nine to seven.",
"updated_at": "2026-09-22T11:30:00.000Z",
"windows": [
{
"day_of_week": 3,
"start_time": "09:00",
"end_time": "19:00"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}inbound_enabled, outbound_enabled, closed_message, timezone and windows:
- Omitting
windowsleaves the existing schedule unchanged. - Including
windows(even as an empty array) overwrites the entire schedule for every day of the week. - Omitting
closed_messageleaves the after-hours message unchanged. - Omitting
timezoneleaves the workspace’s clock unchanged — see The workspace’s clock. - Sending
expected_updated_atmakes the write conditional: see Not overwriting someone else.
POST /calls {"type": "web"} is a rehearsal and is never gated by a window.
Requires call_windows:manage. Replacing the schedule takes every agent in the workspace on or
off the phone, so a key minted for one agent’s management cannot do it. A key without the scope is
refused with 403 INSUFFICIENT_SCOPE and nothing is written. Reading the hours
(GET /call-windows) still needs no scope at all.
Not overwriting someone else
These settings are one record for the whole workspace, and there is no per-agent copy: your integration, a colleague’s dashboard tab and a scheduled job all write the same hours and the same after-hours message. Without a version, the last write wins and the earlier one disappears without a word.GET /call-windows returns an updated_at. Send it back as expected_updated_at and the write
only goes through if the record is still the one you read:
CURRENT=$(curl -s "https://api.goyappr.com/call-windows" \
-H "Authorization: Bearer $YAPPR_API_KEY" | jq -r .updated_at)
curl -X PUT "https://api.goyappr.com/call-windows" \
-H "Authorization: Bearer $YAPPR_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"closed_message\": \"Back Sunday at nine.\", \"expected_updated_at\": \"$CURRENT\"}"
409 CALL_WINDOWS_CONFLICT, nothing is
written, and the message carries the version to re-read against. Read the hours again, decide what
your change means against what is there now, and send the new updated_at.
The field is optional. Omit it and the write is unconditional, exactly as it was before the field
existed — every client that works today keeps working.
Window rules
day_of_weekis0–6(0= Sunday,6= Saturday).start_timeandend_timeareHH:MMstrings in 24-hour format. They are evaluated in the workspace timezone — set it withtimezoneon this request, or under Settings → Workspace clock in the dashboard.start_timemust be strictly earlier thanend_time— there is no overnight wrap-around. To express a window that crosses midnight, use two entries on consecutive days (e.g.{ day_of_week: 4, start_time: "22:00", end_time: "23:59" }and{ day_of_week: 5, start_time: "00:00", end_time: "02:00" }).- Multiple windows per day are allowed but they must not overlap.
The workspace’s clock
timezone is the workspace’s clock, as an IANA name — Asia/Jerusalem, Europe/London, UTC.
A name sent in another case (asia/jerusalem) is stored, and returned, as the zone database spells it (Asia/Jerusalem).
It is one setting for the whole workspace, and it is more than these hours:
- the calling hours above are read on it;
- a relative date an agent collects (“tomorrow”, “next Sunday”) is anchored to its day;
GET /campaigns/defaultssuggests hours in it;GET /billing/consumptionbuckets days and months on it unless you ask for another zone;- the dashboard shows every call and delivery time on it.
UTC and GET /call-windows answers timezone_set: false.
Sending timezone here — UTC included — sets it, and timezone_set turns true.
A workspace with Israeli numbers left on UTC reads every one of those two to three hours off
Israel time. An offset such as +03:00 or an abbreviation such as IDT is refused with 400:
an offset stored as a clock would move every calling hour, and a zone name also follows daylight
saving time, which an offset cannot.
curl -X PUT "https://api.goyappr.com/call-windows" \
-H "Authorization: Bearer $YAPPR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "timezone": "Asia/Jerusalem" }'
The after-hours message
closed_message is what an inbound caller will hear when the window is closed, spoken before the call ends. It is workspace-wide and holds up to 500 characters. The field is stored and returned today, but calls do not speak it yet — out-of-hours calls are still ended in silence until the voice release that picks it up.
curl -X PUT "https://api.goyappr.com/call-windows" \
-H "Authorization: Bearer $YAPPR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"inbound_enabled": true,
"closed_message": "You'"'"'ve reached us outside our hours. We'"'"'re here Sunday to Thursday, nine to seven."
}'
null (or a blank string, which is stored as null) to clear it and go back to ending out-of-hours calls in silence. The message only reaches anyone while inbound_enabled is true.
Example request
# Switch to a Sun–Thu, 09:00–13:00 + 14:00–18:00 schedule. Friday + Saturday closed.
curl -X PUT "https://api.goyappr.com/call-windows" \
-H "Authorization: Bearer $YAPPR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"outbound_enabled": true,
"inbound_enabled": false,
"windows": [
{ "day_of_week": 0, "start_time": "09:00", "end_time": "13:00" },
{ "day_of_week": 0, "start_time": "14:00", "end_time": "18:00" },
{ "day_of_week": 1, "start_time": "09:00", "end_time": "13:00" },
{ "day_of_week": 1, "start_time": "14:00", "end_time": "18:00" },
{ "day_of_week": 2, "start_time": "09:00", "end_time": "13:00" },
{ "day_of_week": 2, "start_time": "14:00", "end_time": "18:00" },
{ "day_of_week": 3, "start_time": "09:00", "end_time": "13:00" },
{ "day_of_week": 3, "start_time": "14:00", "end_time": "18:00" },
{ "day_of_week": 4, "start_time": "09:00", "end_time": "13:00" },
{ "day_of_week": 4, "start_time": "14:00", "end_time": "18:00" }
]
}'
Example response
The response mirrorsGET /call-windows so clients can update state without a follow-up read:
{
"timezone": "Asia/Jerusalem",
"timezone_set": true,
"inbound_enabled": false,
"outbound_enabled": true,
"closed_message": null,
"updated_at": "2026-09-22T11:30:00.000Z",
"windows": [
{ "day_of_week": 0, "start_time": "09:00", "end_time": "13:00" },
{ "day_of_week": 0, "start_time": "14:00", "end_time": "18:00" }
]
}
Disabling windows entirely
To stop gating outbound calls without losing your schedule, set the toggle off and omitwindows:
curl -X PUT "https://api.goyappr.com/call-windows" \
-H "Authorization: Bearer $YAPPR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "outbound_enabled": false }'
day_of_week. To close every day, pass "windows": [].
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | CALL_WINDOWS_REQUEST_INVALID | A body field this route does not read. It takes inbound_enabled, outbound_enabled, closed_message, timezone, windows and expected_updated_at; anything else — a misspelling included — is refused by name and nothing is written. |
| 400 | INVALID_CALL_WINDOWS | Two ranges on the same day overlap, or start_time is not strictly before end_time. |
| 400 | CALL_WINDOWS_REQUEST_INVALID | day_of_week is outside 0..6, or a time is not HH:MM. Every value is checked before expected_updated_at, so a bad window is named even when the version is stale, and nothing — not even a valid toggle beside it — is written. |
| 400 | CALL_WINDOWS_REQUEST_INVALID | closed_message is not a string or null, or is longer than 500 characters. |
| 400 | CALL_WINDOWS_REQUEST_INVALID | timezone is not an IANA timezone name (+03:00, IDT, Asia/Atlantis). The message names it. Nothing was written. |
| 400 | CALL_WINDOWS_REQUEST_INVALID | expected_updated_at is present but is not a timestamp. Omit the field to write unconditionally. |
| 401 | — | Missing or invalid API key. |
| 403 | INSUFFICIENT_SCOPE | The key is valid for this workspace but does not hold call_windows:manage. Nothing was written. |
| 409 | CALL_WINDOWS_CONFLICT | The expected_updated_at you sent is not the current version — someone changed the hours after you read them. Nothing was written. |
Authorizations
Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).
Body
What an inbound caller will hear when the window is closed, spoken before the call ends. Stored and returned today; not spoken yet, so out-of-hours calls are still ended in silence for now. Send null or a blank string to clear it. Omit the field to leave it unchanged.
500The workspace's clock, as an IANA timezone name. The calling hours are read on it, and so are relative dates agents collect, GET /campaigns/defaults and the days of GET /billing/consumption. An offset (+03:00) or an abbreviation (IDT) is refused with 400. A name in another case (asia/jerusalem) is stored as the zone database spells it (Asia/Jerusalem). Omit it to leave the clock unchanged.
"Asia/Jerusalem"
Optional. The updated_at you read from GET /call-windows.
When it no longer matches, the request is refused with
409 CALL_WINDOWS_CONFLICT and nothing is written, so you
never replace a change you have not seen. Omit it to write
unconditionally, which is what every client did before this
field existed.
"2026-09-22T11:30:00.000Z"
Response
Updated configuration
Company-level configuration that gates phone calls by time-of-day.
When outbound_enabled is true, outbound API requests placed outside
any allowed window are deferred — the response is 202 Accepted with
status: "scheduled" and a scheduled_for timestamp marking the next
window opening. When inbound_enabled is true, inbound calls received
outside any allowed window are ended before being answered (no
call_logs row is created).
Browser sessions minted with POST /calls {"type":"web"} are
rehearsals, not customer traffic: they are never gated by either
toggle and always mint immediately, whatever the schedule says.
A day with no windows is a closed day for whichever directions are enforced. The default schedule (seeded for every company) is Sunday through Thursday 09:00–19:00 plus Friday 09:00–11:30; Saturday is closed.
Whether the workspace chose its clock. false means timezone is
the UTC default nobody picked: the calling hours, relative dates
and consumption days are still read on UTC, and the dashboard shows
times on each reader's own browser clock (labelled as such) until the
clock is set. true once any write names timezone, including
UTC on purpose.
true
Optional message an inbound caller will hear when inbound_enabled
is true and the window is closed, spoken before the call ends.
null (the default) ends the call without saying anything. Blank
strings are stored as null. The field is stored and returned
today; calls do not speak it yet, so an out-of-hours call is still
ended in silence until the voice release that picks it up.
500"You've reached us outside our hours. We're here Sunday to Thursday, nine to seven."
The version of this whole record — the hours, the toggles and the
message together. Send it back as expected_updated_at on a
PUT and the write is refused with 409 CALL_WINDOWS_CONFLICT if
anyone changed the hours in between, instead of silently replacing
what they wrote. These settings are workspace-wide, so the other
writer may be a colleague's dashboard tab.
"2026-09-22T11:30:00.000Z"