Skip to content

feat: schedule list gives the account's sending schedules with their windows - #30

Merged
ArtemKosolap merged 3 commits into
mainfrom
dev/REPLY-53113-schedule-list
Oct 25, 2026
Merged

ArtemKosolap merged 3 commits into
mainfrom
dev/REPLY-53113-schedule-list

Conversation

@ArtemKosolap

@ArtemKosolap ArtemKosolap commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What changed

A new work command, reply schedule list, lists every sending schedule the account can use:

reply schedule list --json
# {"items":[{"id":41,"name":"Business hours","time_zone_id":"Eastern Standard Time",
#   "use_recipient_time_zone":false,"exclude_holidays":true,"is_default":true,
#   "main_timings":[{"week_day":"monday","active":true,"ranges":[{"from":"09:00","to":"17:00"}]}],
#   "use_follow_up_schedule":false,"follow_up_timings":[],"reply_status":"isDefaultForCurrentUser"}]}
  • One read, GET /v3/schedules. Reply answers it in full with no paging, so the command makes exactly one call and
    keeps Reply's order.
  • time_zone_id is the Windows time zone identifier Reply holds (Eastern Standard Time), passed through unchanged.
  • main_timings / follow_up_timings hold one entry for each day Reply holds, in Reply's order; an entry that is not
    a day at all is left out. Each day carries week_day in lower case (Reply names days as .NET does,
    Monday), active, and ranges with each time of day written HH:MM from Reply's {hour, minute}. A range may end
    at 24:00. A time that is not a time of day is null, never a guess.
  • Reply's flags appear under the CLI's names (useProspectTimezone becomes use_recipient_time_zone, and so on); a
    flag Reply does not give as true is false; is_default is the calling user's default. A blank name or time
    zone is null. reply_status is Reply's own word for how the schedule is used, the first that holds of its six:
    unknown, inCampaignTemplate, inCurrentUserSequence, inTeamMemberSequence, isDefaultForCurrentUser,
    isDefaultForTeamMember.
  • follow_up_timings is null when Reply gives no list there.
  • The command takes no flag and no argument; either is a usage error (exit 2) before any request.
  • Errors follow the existing house rules: a schedule without a usable id is reply.unavailable; a 403, which this
    endpoint answers only to a key without Reply's sequences read scope (a problem+json insufficient_scope body with no
    code), is access.feature_unavailable; 401 is access.denied; 5xx or an answer that is not a list is reply.unavailable.
  • --help documents the result shape, the time zone, weekday, time and state formats, and the error codes. The README's
    table and work-commands section list the command.

Why

An agent that plans or checks when a sequence will send needs the schedules the account has, their time zones and
their windows, in a stable shape. Today that takes reply api /v3/schedules and reading Reply's raw model; this gives it
the same first-class, documented --json contract as account list.

How it was verified

  • npm run build and npm test: 58 files, 862 passed, 5 skipped (the skips existed before). The change adds 9 tests:
    • schedules.test.ts (7): the full shape and the single request; an empty account; blank or missing names, time
      zones and state words; flags only true when Reply says true; follow-up windows that are not a list; unreadable
      days, ranges and times, including 24:00; a schedule without a usable id; and the refusals (Reply's insufficient_scope
      403, 401, 503, an object instead of a list).
    • commands.test.ts (1): the command takes no flags or arguments and its help states the formats, Reply's six state
      words, and the scope refusal.
    • program.test.ts (1): through the whole program, a flag or an id exits 2 with no request, and Reply's
      insufficient_scope 403 exits 1 with {"error":{"code":"access.feature_unavailable","status":403}} on stderr.
  • The built dist/index.js was run against a loopback HTTP server answering /v3/schedules with a recorded-shape
    body. It printed the expected items exactly (exit 0), the 403 envelope (exit 1), and exit 2 for --name x and for
    an extra argument. Nothing contacted Reply.
  • commitlint passes over every commit.

…windows

One GET /v3/schedules, which Reply answers in full with no paging. Each schedule
carries its Windows time zone identifier as Reply holds it, its flags under the
CLI's names, its windows by weekday (the weekday in lower case, each time of day
as HH:MM) and Reply's own word for how it is used. A schedule without a usable
id is reply.unavailable; a refusal is the house refusal, so a plan or role
without the scheduler is access.feature_unavailable.
The only thing that refuses the read is Reply's sequences read scope, so
the help, the README and the tests now say so and fake the refusal Reply sends: a
problem+json insufficient_scope body with no code. The help names the
six reply_status words, says is_default is the caller's own default and
that main_timings holds one entry for each day Reply holds.
@ArtemKosolap
ArtemKosolap merged commit 231c107 into main Oct 25, 2026
6 checks passed
@ArtemKosolap
ArtemKosolap deleted the dev/REPLY-53113-schedule-list branch October 25, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants