Skip to content

ServiceType (Services)

A Service Type is a container for plans.

A Service Type is a container for plans.

Property Value
Product Services (pco.services, API version 2018-11-01)
Resource type ServiceType
TypeScript Services.ServiceType, attributes Services.ServiceTypeAttributes, schema Services.ServiceTypeSchema
Planning Center path /services/v2/service_types
Planning Center docs ServiceType

How to reach it

Client path Returns Filters Create
pco.services.service_types Collection no_parent Yes
pco.services.folders.id(folderId).service_types Collection Yes
pco.services.series.id(seriesId).plans.id(planId).live.id(liveId).service_type Collection No
pco.services.teams.id(teamId).service_types Collection No

From a collection, .id(serviceTypeId) addresses one ServiceType: pco.services.service_types.id(serviceTypeId). Collections support where, include, order, and pagination; single resources have get().

Attributes

On Services.ServiceTypeAttributes. Every resource also has id and type ('ServiceType') next to its attributes.

Name Type Description
archived_at string | null
attachment_types_enabled boolean | null
background_check_permissions string | null
comment_permissions string | null DEPRECATED: this attribute will be removed in the next release and will return the string “DEPRECATED” in this version
created_at string | null
custom_item_types unknown[] | null See details.
deleted_at string | null
frequency string | null
last_plan_from string | null
name string | null
permissions string | null
scheduled_publish boolean | null
sequence number | null
standard_item_types unknown[] | null See details.
updated_at string | null

Attribute details

custom_item_types

A array of hashes that maps an item title substring matcher to a color:

[{ name: “Announcements”, color: “#FFFFFF” }]

Valid substring matchers are any string that could be used as an item title.

A color is the hexadecimal value of a valid color e.g. #FFFFFF Valid colors values are #e8f6df, #e0f7ff, #e6e2fd, #ffe0e8, #ffedd1, #cfcfcf, #eaebeb, and #ffffff

standard_item_types

An array of hashes that maps an item type to a color:

[{ name: “Header”, color: “#FFFFFF” }]

Valid names are Header, Song, and Media.

A color is the hexadecimal value of a valid color e.g. #FFFFFF Valid colors values are #e8f6df, #e0f7ff, #e6e2fd, #ffe0e8, #ffedd1, #cfcfcf, #eaebeb, and #ffffff

Relationships and includes

Side-load with include() (or get({ include })) and read with related(resource, name): time_preference_options.

Relationship Type To Includable
parent To one Folder No

Querying

Where

where(field, value) for equality; where(field, op, value) with the operators listed.

Field Value type Operators
id string Equality only
name string Equality only
parent_id string | number Equality only

Order

order(...) accepts these fields, ascending, or descending with a - prefix: name, sequence.

Filters

filter(...) names depend on the edge you query through:

Edge Filters
pco.services.service_types no_parent

Edges

Follow these from one ServiceType, ref = pco.services.service_types.id(serviceTypeId):

Edge Leads to Returns Filters Create
ref.attachments Attachment Collection Yes
ref.item_note_categories ItemNoteCategory Collection No
ref.live_controllers LiveController Collection No
ref.plan_note_categories PlanNoteCategory Collection No
ref.plan_person_times PlanPersonTime Collection No
ref.plan_templates PlanTemplate Collection Yes
ref.plan_times PlanTime Collection future, named, not_deleted, past No
ref.plans Plan Collection after, before, future, no_dates, past Yes
ref.public_view PublicView Collection No
ref.team_positions TeamPosition Collection No
ref.teams Team Collection Yes
ref.time_preference_options TimePreferenceOption Collection No
ref.unscoped_plans Plan Collection deleted No

Writing

Property Value
Create Yes, create() on pco.services.service_types, service_types on Folder
Update Yes, update() on a reference
Delete Yes, delete() on a reference

Create attributes

Typed as Services.ServiceTypeSchema['create'].

Attribute Type
attachment_types_enabled boolean | null
background_check_permissions string | null
create_teams unknown
custom_item_types unknown[] | null
frequency string | null
last_plan_from string | null
name string | null
parent_id string
scheduled_publish boolean | null
sequence number | null
standard_item_types unknown[] | null

Update attributes

Typed as Services.ServiceTypeSchema['update'].

Attribute Type
attachment_types_enabled boolean | null
background_check_permissions string | null
create_teams unknown
custom_item_types unknown[] | null
frequency string | null
last_plan_from string | null
name string | null
parent_id string
scheduled_publish boolean | null
sequence number | null
standard_item_types unknown[] | null

See Writing data.

Actions

Run with ref.action(name, body?). Bodies are untyped: see Planning Center’s docs for each action.

Action Path Description
create_plans POST /services/v2/service_types/{service_type_id}/create_plans Create multiple plans

Example

import type { Services } from '@mackenly/planningcenterkit';

const page = await pco.services.service_types.order('name').perPage(25).list();
const items: Services.ServiceType[] = page.data;

Type to search…

↑↓ navigate↵ selectEsc close