Preview new plans

Compute the plans that POST /api/plans would create with the given options, without creating anything. Option "none" returns undated plans, "copy" repeats the times of the plan given in copy at the same wall-clock times in the new plans' time zone, and "custom" builds the first plan from times; later plans follow the service type's frequency starting from start. Pass the returned list back to the create endpoint as preview, optionally setting template on individual entries. When previewing a copy, send the copied plan as sourcePlan so the times land in the time zone the copy is stored in, and so a narrowed caller previews where their copy lands.

Required permission: Full Write Service Plans

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

The options for the new plans

type
object | null

The service type of the new plans.

int32

The number of plans to create.

int32 | null

The id of the plan whose times are repeated at the same wall-clock times in the new plans' time zone, when the option is "copy". While multi-campus is on, the copy source must be a plan the caller can open; otherwise the request answers 404.

string | null

How the plans' times are determined: "none" creates undated plans, "copy" repeats the times of the plan given in copy at the same wall-clock times in the new plans' time zone, and "custom" builds the first plan from times. Required when previewing.

date-time | null

The first plan's day, as a UTC instant read in the plan's time zone (its campus's own zone, else its organization's, else the account's; an Organizations-mode plan uses its owner organization's): only that local day is used, and plan times come from times or the copied plan. Prefer startDate, since midnight UTC falls on the previous day for churches west of UTC. Later plans follow the service type's frequency. Required unless the option is "none".

date | null

The first plan's calendar day in the plan's time zone (yyyy-MM-dd). Composes start (midnight in that zone) when start is omitted; ignored when start is sent. Also the day of every entry in times that carries no startDate.

campuses
array of objects | null

The campuses the new plans belong to, ordered by name; empty when it is available to every campus. On writes,
send the ids to set the campus set (an empty list means every campus); omit the property to keep using
location alone. A campus-limited caller can only add or remove campuses within their access and
cannot change whether the record is available to every campus.
Ignored while multi-campus is off.

campuses
organizations
array of objects | null

The organizations this record is scoped to, all their campuses now and in the future, in name order; empty
unless the record is organization-scoped (then campuses is empty). Honoured only while multi-org is
on. Omit to keep the current organizations.

organizations
primaryCampus
object | null

The campus whose time zone the plan's times are entered and shown in; one of campuses, null when
the plan is available to every campus. On writes it may be omitted: the current primary is kept while it stays
in the set, else the only selected campus, else the caller's own campus when selected, else the first sent.
Ignored while multi-campus is off.

primaryOrganization
object | null

The organization whose time zone the new plans' times are entered and shown in when their organizations are in
different time zones; one of organizations. It is taken only while the organizations are in
different time zones, when a value that is not one of them is refused; while they share a zone, or with one
organization, campuses or every campus, a value sent is ignored. When omitted the organization with the lowest
id gives the zone, except on a copy made while multi-campus is off, which keeps the copied plan's primary
organization while it is one of the organizations. A copy made while multi-campus is on reads it as a create,
so it keeps the copied plan's primary organization only when that is sent and the organizations are still in
different time zones. The preview reads it exactly as the create does; to preview a copy made while multi-campus
is off the same way, send the copied plan as the preview's sourcePlan. An archived primary organization's zone is
ignored (the account zone applies). Honoured only while multi-org is on.

times
array of objects | null

The service and rehearsal times of the first plan, when the option is "custom": instants, or startTime / endTime in the plan's time zone on the day given by startDate.

times
sourcePlan
object | null

The plan being copied, when previewing the new plans of a copy (POST /api/plans/{id}/copy with option "new_plan"); only
its id is used. While multi-campus is off a copy keeps that plan's campuses and organizations, so the preview reads them
the same way and composes its times in the time zone the copy is stored in. While multi-campus is on or an organization limit
binds, a caller a campus limit or restricting override narrows at the permission previews where their copy lands, as the copy
reads it. Otherwise ignored while multi-campus is on, when a copy is read as a create. Omit it when previewing new plans that
are not a copy.

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

401

Authentication is required, or the Ocs-Api-Key header is missing or invalid.

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json