A folder is a container used to organize multiple Service Types or other Folders.
| Property | Value |
|---|---|
| Product | Services (pco.services, API version 2018-11-01) |
| Resource type | Folder |
| TypeScript | Services.Folder, attributes Services.FolderAttributes, schema Services.FolderSchema |
| Planning Center path | /services/v2/folders |
| Planning Center docs | Folder |
How to reach it
| Client path | Returns | Filters | Create |
|---|---|---|---|
pco.services.folders |
Collection | Yes | |
pco.services.folders.id(folderId).folders |
Collection | No | |
pco.services.tag_groups.id(tagGroupId).folder |
Collection | No |
From a collection, .id(folderId) addresses one Folder: pco.services.folders.id(folderId). Collections support where, include, order, and pagination; single resources have get().
Attributes
On Services.FolderAttributes. Every resource also has id and type ('Folder') next to its attributes.
| Name | Type | Description |
|---|---|---|
container |
string | null |
|
created_at |
string | null |
|
name |
string | null |
|
updated_at |
string | null |
Relationships and includes
Side-load with include() (or get({ include })) and read with related(resource, name): service_types.
| Relationship | Type | To | Includable |
|---|---|---|---|
ancestors |
To one | Folder | No |
campus |
To one | Campus |
No |
parent |
To one | Folder | No |
Querying
Where
where(field, value) for equality; where(field, op, value) with the operators listed.
| Field | Value type | Operators |
|---|---|---|
parent_id |
string | number |
Equality only |
Order
order(...) accepts these fields, ascending, or descending with a - prefix: name.
Edges
Follow these from one Folder, ref = pco.services.folders.id(folderId):
| Edge | Leads to | Returns | Filters | Create |
|---|---|---|---|---|
ref.folders |
Folder | Collection | No | |
ref.service_types |
ServiceType | Collection | Yes |
Writing
| Property | Value |
|---|---|
| Create | Yes, create() on pco.services.folders |
| Update | Yes, update() on a reference |
| Delete | Yes, delete() on a reference |
Create attributes
Typed as Services.FolderSchema['create'].
| Attribute | Type |
|---|---|
campus_id |
string |
name |
string | null |
parent_id |
string |
Update attributes
Typed as Services.FolderSchema['update'].
| Attribute | Type |
|---|---|
campus_id |
string |
name |
string | null |
parent_id |
string |
See Writing data.
Example
import type { Services } from '@mackenly/planningcenterkit';
const page = await pco.services.folders.order('name').perPage(25).list();
const items: Services.Folder[] = page.data;