Skip to main content
PUT
/
call-windows
Replace call time windows
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,
  "windows": [
    {
      "day_of_week": 3,
      "start_time": "09:00",
      "end_time": "19:00"
    }
  ]
}
'
{
  "timezone": "Asia/Jerusalem",
  "inbound_enabled": true,
  "outbound_enabled": true,
  "windows": [
    {
      "day_of_week": 3,
      "start_time": "09:00",
      "end_time": "19:00"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.goyappr.com/llms.txt

Use this file to discover all available pages before exploring further.

Atomically replaces the call window configuration. Send any combination of inbound_enabled, outbound_enabled, and windows:
  • Omitting windows leaves the existing schedule unchanged.
  • Including windows (even as an empty array) overwrites the entire schedule for every day of the week.
Any authenticated API key for the workspace can call this — no specific scope is required.

Window rules

  • day_of_week is 06 (0 = Sunday, 6 = Saturday).
  • start_time and end_time are HH:MM strings in 24-hour format. They are evaluated in the workspace timezone (companies.timezone, editable from the Company settings tab).
  • start_time must be strictly earlier than end_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.

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 mirrors GET /call-windows so clients can update state without a follow-up read:
{
  "timezone": "Asia/Jerusalem",
  "inbound_enabled": false,
  "outbound_enabled": true,
  "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 omit windows:
curl -X PUT "https://api.goyappr.com/call-windows" \
  -H "Authorization: Bearer $YAPPR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "outbound_enabled": false }'
To make a day fully closed, simply omit any windows for that day_of_week. To close every day, pass "windows": [].

Errors

HTTPCodeWhen
400INVALID_CALL_WINDOWSTwo ranges on the same day overlap, or start_time is not strictly before end_time.
400day_of_week is outside 0..6, or a time is not HH:MM.
401Missing or invalid API key.

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys.

Body

application/json
inbound_enabled
boolean

When true, inbound calls outside the window are hung up before answering.

outbound_enabled
boolean

When true, outbound calls outside the window are scheduled for the next opening.

windows
object[]

Full replacement set of windows. Empty array = no allowed windows on any day.

Response

Updated configuration

Company-level configuration that gates inbound and outbound 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 hung up before being answered (no call_logs row is created).

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.

timezone
string

IANA timezone identifier. Reflects companies.timezone. Edit it in the Company settings tab.

Example:

"Asia/Jerusalem"

inbound_enabled
boolean

When true, inbound calls outside the window are hung up before answering. Default false.

outbound_enabled
boolean

When true, outbound calls outside the window are scheduled for the next opening. Default true.

windows
object[]