# PimCollection

The PimCollection type of the TypeScript SDK, which calendars.create and 9 more methods take or answer.

```ts
type PimCollection = {
  color: string | null
  components: ('VEVENT' | 'VTODO')[] | null
  createdAt: number
  description: string | null
  descriptionLang: string | null
  displayName: string | null
  id: string
  kind: ('calendar' | 'addressbook')
  myPermission: ('owner' | 'read' | 'read-write')
  name: string
  objectCount: number
  ownerAddress: string | null
  ownerIdentityId: string
  role: string | null
  scheduleTransp: ('opaque' | 'transparent')
  syncToken: string
  taskCounts: PimCollectionTaskCounts
  visibility: ('private' | 'shared' | 'public')
}
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `color` | `string` \| `null` | Hex color code (e.g. #3b82f6), or null |
| `components` | `('VEVENT' \| 'VTODO')[] \| null` | Supported primary components, in VEVENT then VTODO order; null for addressbooks. Legacy mixed calendars may also retain journals or unparsed resources. Narrowing refuses with components_conflict and a count of incompatible live and restorable trashed objects. |
| `createdAt` | `number` | Creation timestamp in epoch seconds |
| `description` | `string` \| `null` | Collection description, or null |
| `descriptionLang` | `string` \| `null` | BCP 47 language tag (xml:lang) of the collection description, or null |
| `displayName` | `string` \| `null` | Display name of the calendar or addressbook, or null |
| `id` | `string` | Collection ULID: stable across renames; the JMAP id |
| `kind` | `('calendar' \| 'addressbook')` | Collection type ('calendar' or 'addressbook') |
| `myPermission` | `('owner' \| 'read' \| 'read-write')` | What the CALLING identity may do with this collection: 'owner' for its own, otherwise the granted level. |
| `name` | `string` | URL path segment slug (e.g. 'work-calendar') |
| `objectCount` | `number` | Total number of events, tasks, or contacts in this collection |
| `ownerAddress` | `string` \| `null` | Primary address of the owning mailbox, or null when it has none |
| `ownerIdentityId` | `string` | Identity ULID that owns this collection |
| `role` | `string` \| `null` | Special role ('default', 'tasks'), or null |
| `scheduleTransp` | `('opaque' \| 'transparent')` | RFC 6638 §9.1 CALDAV:schedule-calendar-transp — whether this calendar's objects contribute to the owner's free/busy. `transparent` excludes the whole calendar (a birthdays or subscribed-holidays feed); `opaque` is the default the RFC assumes when the property is absent. An addressbook always reports `opaque` and cannot be set otherwise: the property is defined for calendar collections, and the addressbook PATCH body does not carry it |
| `syncToken` | `string` | Opaque sync token for delta synchronization |
| `taskCounts` | [`PimCollectionTaskCounts`](/docs/sdks/typescript/types/pim-collection-task-counts) | Members that are tasks, split by the two `progress` buckets. Exact complements; events and contacts are in neither, so the pair need not sum to `objectCount`. |
| `visibility` | `('private' \| 'shared' \| 'public')` | Access visibility scope |

## Used by

| Method | What it does |
| --- | --- |
| [`calendars.create`](/docs/sdks/typescript/calendars/create) | Create calendar |
| [`calendars.list`](/docs/sdks/typescript/calendars/list) | List calendars |
| [`calendars.get`](/docs/sdks/typescript/calendars/get) | Get calendar by ID |
| [`calendars.getByName`](/docs/sdks/typescript/calendars/get-by-name) | Get calendar by name |
| [`calendars.update`](/docs/sdks/typescript/calendars/update) | Update calendar |
| [`addressbooks.create`](/docs/sdks/typescript/addressbooks/create) | Create addressbook |
| [`addressbooks.list`](/docs/sdks/typescript/addressbooks/list) | List addressbooks |
| [`addressbooks.get`](/docs/sdks/typescript/addressbooks/get) | Get addressbook by ID |
| [`addressbooks.getByName`](/docs/sdks/typescript/addressbooks/get-by-name) | Get addressbook by name |
| [`addressbooks.update`](/docs/sdks/typescript/addressbooks/update) | Update addressbook |

## Used in

[`PimCollectionRestored`](/docs/sdks/typescript/types/pim-collection-restored).
