---
title: "Folder (Services)"
description: "A folder is a container used to organize multiple Service Types or other Folders."
---

> Documentation Index
> Fetch the complete documentation index at: https://planningcenterkit.mackenly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Folder (Services)

A folder is a container used to organize multiple Service Types or other Folders.

| Property | Value |
| --- | --- |
| Product | [Services](/reference/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](https://api.planningcenteronline.com/docs/apps/services/versions/2018-11-01/vertices/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](/guides/querying/); 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](/reference/services/folder/) | No |
| `campus` | To one | `Campus` | No |
| `parent` | To one | [Folder](/reference/services/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](/reference/services/folder/) | Collection |  | No |
| `ref.service_types` | [ServiceType](/reference/services/service-type/) | 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](/guides/writing-data/).

## Example

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

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

Source: https://planningcenterkit.mackenly.com/reference/services/folder/index.mdx
