> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Passcreator API reference

> API reference for the Passcreator plugin in Corsair: every `passcreator.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Passes

### activeHistory

`passes.activeHistory`

Read the history of active and inactive passes of a template

**Risk:** `read`

```ts theme={null}
await corsair.passcreator.api.passes.activeHistory({ templateUid: "6d03a4a9-cf92-4e36-80b4-a8994546e2f", day: "2025-01-15" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateUid` | `string` | Yes | Pass-template UID |
| `day` | `string` | No | First day of the history (YYYY-MM-DD); omit for the last seven days |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   date: string,
>   active?: number | null,
>   inactive?: number | null
> }[]
> ```

***

### create

`passes.create`

Create a pass from a pass template with personalised properties

**Risk:** `write`

```ts theme={null}
await corsair.passcreator.api.passes.create({ passtemplate: "6d03a4a9-cf92-4e36-80b4-a8994546e2f", properties: { firstname: "John" } });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `passtemplate` | `string` | Yes | Pass-template UID the pass is created from |
| `properties` | `Record<string, any>` | Yes | Additional properties keyed by property name or ID |

Property keys are the template's property names or property IDs; templates.fields lists both. The answer is the created pass.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `passId` | `string \| null` | No | Pass id |
| `identifier` | `string \| null` | No | Pass identifier (UUID, barcode value or user-provided ID) |
| `uniqueIdentifier` | `string \| null` | No | Pass UID |
| `barcodeValue` | `string \| null` | No | Barcode value |
| `linkToPassPage` | `string \| null` | No | Link to the pass page in the wallet app |
| `passTemplate` | `string \| null` | No | Template name |
| `passTemplateGuid` | `string \| null` | No | Template UID |
| `createdOn` | `string \| null` | No | Creation timestamp |
| `voided` | `boolean \| null` | No | Whether the pass is voided |

***

### delete

`passes.delete`

Delete a pass

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.passcreator.api.passes.delete({ passUid: "54b4d891-4454-435d-b07f-308d01b187d3" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | Pass UID, barcode value or user-provided ID |

Answers a success envelope.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | The pass the call was for |
| `success` | `boolean` | Yes | Whether the call succeeded |

***

### enableDownload

`passes.enableDownload`

Enable the download of a pass

**Risk:** `write`

```ts theme={null}
await corsair.passcreator.api.passes.enableDownload({ passUid: "54b4d891-4454-435d-b07f-308d01b187d3" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | Pass UID |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | Pass UID |
| `success` | `boolean` | Yes | Whether the enable succeeded |

***

### get

`passes.get`

Read one pass by UID, barcode value or user-provided ID

**Risk:** `read`

```ts theme={null}
await corsair.passcreator.api.passes.get({ passUid: "54b4d891-4454-435d-b07f-308d01b187d3" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | Pass UID, barcode value or user-provided ID |
| `includeFieldMapping` | `boolean` | No | Include the field mapping of the pass |
| `appConfigurationId` | `string` | No | Read the pass as a specific app configuration sees it |

passUid accepts the pass UID, the barcode value or a user-provided ID.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `passId` | `string \| null` | No | Pass id |
| `identifier` | `string \| null` | No | Pass identifier (UUID, barcode value or user-provided ID) |
| `uniqueIdentifier` | `string \| null` | No | Pass UID |
| `barcodeValue` | `string \| null` | No | Barcode value |
| `linkToPassPage` | `string \| null` | No | Link to the pass page in the wallet app |
| `passTemplate` | `string \| null` | No | Template name |
| `passTemplateGuid` | `string \| null` | No | Template UID |
| `createdOn` | `string \| null` | No | Creation timestamp |
| `voided` | `boolean \| null` | No | Whether the pass is voided |

***

### list

`passes.list`

List the passes of a pass template, paged by cursor and date

**Risk:** `read`

```ts theme={null}
await corsair.passcreator.api.passes.list({ templateUid: "6d03a4a9-cf92-4e36-80b4-a8994546e2f", start: 0, pageSize: 100 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateUid` | `string` | Yes | Pass-template UID to list passes of |
| `start` | `number` | No | Offset of the first pass to return |
| `pageSize` | `number` | No | Number of passes per page (max 100) |
| `lastIdOfPriorPage` | `string` | No | Identifier of the last pass of the prior page, for cursor paging |
| `lastCreatedOnOfPriorPage` | `string` | No | createdOn of the last pass of the prior page, for cursor paging |
| `createdSince` | `string` | No | Only passes created after this date, e.g. "2021-07-01 15:30" |
| `modifiedSince` | `string` | No | Only passes modified after this date, e.g. "2021-07-01 15:30" |

Cursor paging: pass lastIdOfPriorPage and lastCreatedOnOfPriorPage from the prior page along with start and pageSize.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `object \| null` | No | The query and its paging links |
| `total` | `number \| null` | No | Total passes matching the query |
| `results` | `object[]` | Yes | The passes on this page |

> [accordion] query full type
>
> ```ts theme={null}
> {
>   start?: number | null,
>   pageSize?: number | null,
>   self?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] results full type
>
> ```ts theme={null}
> {
>   passId?: string | null,
>   identifier?: string | null,
>   uniqueIdentifier?: string | null,
>   barcodeValue?: string | null,
>   linkToPassPage?: string | null,
>   passTemplate?: string | null,
>   passTemplateGuid?: string | null,
>   createdOn?: string | null,
>   voided?: boolean | null
> }[]
> ```

***

### pushNotification

`passes.pushNotification`

Push a notification message to one pass holder; the message goes out and cannot be recalled

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.passcreator.api.passes.pushNotification({ passUid: "54b4d891-4454-435d-b07f-308d01b187d3", message: "Your coupon is expiring" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | Pass UID |
| `message` | `string` | Yes | Text pushed to the pass holder (sent as pushNotificationText); may use \{Property} placeholders |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | The pass the call was for |
| `success` | `boolean` | Yes | Whether the call succeeded |

***

### search

`passes.search`

Search the passes of a template by content

**Risk:** `read`

```ts theme={null}
await corsair.passcreator.api.passes.search({ templateUid: "6d03a4a9-cf92-4e36-80b4-a8994546e2f", searchTerm: "johnny" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateUid` | `string` | Yes | Pass-template UID to search in |
| `searchTerm` | `string` | Yes | Search term matched against pass content |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   passId?: string | null,
>   identifier?: string | null,
>   uniqueIdentifier?: string | null,
>   barcodeValue?: string | null,
>   linkToPassPage?: string | null,
>   passTemplate?: string | null,
>   passTemplateGuid?: string | null,
>   createdOn?: string | null,
>   voided?: boolean | null
> }[]
> ```

***

### sendEmail

`passes.sendEmail`

Send the pass to an email address; the email goes out and cannot be recalled

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.passcreator.api.passes.sendEmail({ passUid: "54b4d891-4454-435d-b07f-308d01b187d3", email: "john.doe@example.com" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | Pass UID, barcode value or user-provided ID |
| `email` | `string` | Yes | Email address the pass link is sent to |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | The pass the call was for |
| `success` | `boolean` | Yes | Whether the call succeeded |

***

### statistics

`passes.statistics`

Read pass usage statistics of a template by day, week or month

**Risk:** `read`

```ts theme={null}
await corsair.passcreator.api.passes.statistics({ templateUid: "6d03a4a9-cf92-4e36-80b4-a8994546e2f", timeFrame: "day", day: "today" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateUid` | `string` | Yes | Pass-template UID |
| `timeFrame` | `day \| week \| month` | No | Statistics granularity |
| `day` | `string` | No | The day to report, e.g. "today" or 2025-01-15 |

**Output:** *empty object*

***

### update

`passes.update`

Update pass properties or mark the pass voided or not voided

**Risk:** `write`

```ts theme={null}
await corsair.passcreator.api.passes.update({ passUid: "54b4d891-4454-435d-b07f-308d01b187d3", properties: { firstname: "Jane" }, voided: false });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | Pass UID, barcode value or user-provided ID |
| `properties` | `Record<string, any>` | No | Additional properties to update |
| `voided` | `boolean` | No | Mark the pass voided (true) or not voided (false), as the mark-voided section documents |

Answers 204 with no body; the voided flag marks or unmarks a pass as voided.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | Updated pass UID |
| `success` | `boolean` | Yes | Whether the update succeeded |

***

### uris

`passes.uris`

Read the resource URIs of a pass

**Risk:** `read`

```ts theme={null}
await corsair.passcreator.api.passes.uris({ passUid: "54b4d891-4454-435d-b07f-308d01b187d3" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | Pass UID |

**Output:** *empty object*

***

## Templates

### copy

`templates.copy`

Copy a pass template

**Risk:** `write`

```ts theme={null}
await corsair.passcreator.api.templates.copy({ templateUid: "6d03a4a9-cf92-4e36-80b4-a8994546e2f", name: "Coupon copy" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateUid` | `string` | Yes | Template UID to copy |
| `name` | `string` | Yes | Name of the copy |
| `description` | `string` | No | Description of the copy; defaults to the original |
| `organizationName` | `string` | No | Organization name of the copy; defaults to the original |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `identifier` | `string \| null` | No | UUID of the new template |

***

### delete

`templates.delete`

Delete a pass template; the API refuses when scheduled tasks exist

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.passcreator.api.templates.delete({ templateUid: "6d03a4a9-cf92-4e36-80b4-a8994546e2f" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateUid` | `string` | Yes | Template UID |

The API refuses with 400 while scheduled push notifications exist for the template.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateUid` | `string` | Yes | Deleted template UID |
| `success` | `boolean` | Yes | Whether the delete succeeded |

***

### fields

`templates.fields`

Read the required and optional fields of a pass template

**Risk:** `read`

```ts theme={null}
await corsair.passcreator.api.templates.fields({ templateUid: "6d03a4a9-cf92-4e36-80b4-a8994546e2f" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateUid` | `string` | Yes | Template UID |

The zapierStyle field list; use these keys to personalise passes.

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   type?: string | null
> }[]
> ```

***

### list

`templates.list`

List all pass templates of the account

**Risk:** `read`

```ts theme={null}
await corsair.passcreator.api.templates.list({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   identifier: string,
>   name?: string | null
> }[]
> ```

***

### movePass

`templates.movePass`

Move a pass to a different template of the same project (API v2)

**Risk:** `write`

```ts theme={null}
await corsair.passcreator.api.templates.movePass({ passUid: "54b4d891-4454-435d-b07f-308d01b187d3", targetTemplateIdentifier: "ad0dac69-cf92-4e36-80b4-a8994546e2f" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `passUid` | `string` | Yes | Pass UID, barcode value or user-provided ID |
| `targetTemplateIdentifier` | `string` | Yes | UID of the template the pass moves to (same project and signing certificate) |

API v2. Both templates must belong to the same project and share a signing certificate.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | Whether the operation succeeded |
| `description` | `string \| null` | No | Human-readable result description |
| `statusCode` | `number \| null` | No | HTTP status code of the response |

***

## Webhooks

### getPublicKey

`webhooks.getPublicKey`

Read the PEM public key that verifies webhook payload signatures

**Risk:** `read`

```ts theme={null}
await corsair.passcreator.api.webhooks.getPublicKey({});
```

**Input:** *empty object*

Returns the PEM public key the deliveries are signed with; store it with keys.set\_webhook\_signature so the plugin verifies deliveries.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `publicKey` | `string` | Yes | PEM-encoded public key used to verify webhook payload signatures |

***

### list

`webhooks.list`

List the active webhook subscriptions, including pull-mode entries

**Risk:** `read`

```ts theme={null}
await corsair.passcreator.api.webhooks.list({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   subscription_url?: string | null,
>   target_url?: string | null,
>   event?: string | null,
>   pass_template?: string | null,
>   pull_mode?: boolean | null
> }[]
> ```

***

### subscribe

`webhooks.subscribe`

Subscribe a URL to a webhook event, optionally scoped to one template

**Risk:** `write`

```ts theme={null}
await corsair.passcreator.api.webhooks.subscribe({ target_url: "https://example.com/webhooks/passcreator", event: "pass_created" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `target_url` | `string` | Yes | Endpoint deliveries are posted to; the plugin adds this account's corsair\_token query parameter, which the webhook handler requires |
| `event` | `string` | Yes | Event to subscribe to, e.g. pass\_created, pass\_updated, pass\_voided, pushnotification\_registered, pass\_template\_created, pass\_template\_updated, app\_scan\_created |
| `pass_template` | `string` | No | Scope the subscription to one pass-template UID (sent in the path) |
| `subscription_url` | `string` | No | Optional URL that identifies this subscription |
| `retryEnabled` | `boolean` | No | Retry failed deliveries |
| `signPayload` | `boolean` | No | Sign deliveries (default true here: the receiver rejects unsigned ones) |

Events include pass\_created, pass\_updated, pass\_voided, pushnotification\_registered, pass\_template\_created, pass\_template\_updated and app\_scan\_created; pass\_template scopes the subscription to one template, and signPayload defaults to true so deliveries can be verified; the target URL gets this account's corsair\_token, which the webhook handler requires.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `accessToken` | `string \| null` | No | Only returned with generateAccessToken |

***

### unsubscribe

`webhooks.unsubscribe`

Unsubscribe a webhook; deliveries stop until it is subscribed again

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.passcreator.api.webhooks.unsubscribe({ target_url: "https://example.com/webhooks/passcreator?corsair_token=<token from webhooks.list>" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `target_url` | `string` | Yes | target\_url the subscription was created with, including its corsair\_token (as webhooks.list shows it) |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | Whether the unsubscribe succeeded |

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.