# Pass imports

Passes · PassBook API reference. Authenticate with `Authorization: Bearer $PASSBOOK_KEY`.

## Recent imports of this mode {#list}

`GET /api/v1/pass-imports`

Scopes: `passes:read`. SDK name: `pb.passImports.list`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `cursor` | query | string · max 512 |  |  |
| `limit` | query | integer · ≥ 1 · ≤ 50 |  |  |

Returns `200`.

| Code | Status | Fix |
| --- | --- | --- |
| `ASSET_DIMENSIONS` |  | Resize the image to the size named in issues and upload it again. |
| `ASSET_NOT_FOUND` |  | Check the image name or id and that it belongs to this organization. |
| `ASSET_NOT_PNG` |  | Re-export the image as a standard RGB or RGBA PNG and upload it again. |
| `ASSET_SIZE` |  | Compress the image below 1 MB and upload it again. |
| `ASSET_SLOT` |  | Use a slot name from the pass type's image slots in the request path. |
| `BULK_RUN_ACTIVE` |  | Wait for the running job to finish, then start the new one. |
| `BUNDLE_TOO_LARGE` |  | Split the passes across smaller bundles. |
| `CONNECTION_ORG` |  | Use a connection id from your own organization's GET /api/v1/connections. |
| `CONNECTION_TRANSFER_PENDING` |  | Wait for the transfer to finish, then send the request again. |
| `CREATE_STALE` |  | Look the pass up by externalId with GET /api/v1/passes and update it instead of creating it again. |
| `CREDENTIAL_REF_KEYSET_CONFIG_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `CREDENTIAL_REF_KEYSET_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `DELIVERY_STALE` |  | Review the recipient and try again. |
| `DEVICE_TOKEN_UNAVAILABLE` |  | Retry the request; if it persists, send the requestId to support. |
| `EMAIL_INVALID` |  | Send a valid address in the email field. |
| `EXTERNAL_ID_TAKEN` |  | Send a new externalId, or PATCH the existing pass. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDEMPOTENCY_IN_PROGRESS` |  | Wait a moment and resend the identical request. |
| `IDEMPOTENCY_KEY_INVALID` |  | Send a unique string of 1 to 200 characters, such as a UUID. |
| `IDEMPOTENCY_KEY_REUSED` |  | Use a new key for a new request; resend the identical request to replay. |
| `IF_MATCH_INVALID` |  | Send the version from the last GET, for example If-Match: 3. |
| `IMPORT_BUSY` |  | Wait for it to finish with GET /api/v1/pass-imports/{id}, then retry. |
| `IMPORT_COLUMN_MISSING` |  | Add the column to the file, or change the mapping, then check again. |
| `IMPORT_EXPIRED` |  | Upload the file again with POST /api/v1/pass-imports. |
| `IMPORT_FILE_GONE` |  | Upload it again. |
| `IMPORT_HAS_ERRORS` |  | Fix the rows listed in GET /api/v1/pass-imports/{id}/errors.csv, or skip them, then commit again. |
| `IMPORT_HEADER_TOO_LONG` |  | Shorten the header and upload the file again. |
| `IMPORT_ID_TAKEN` |  | Check the import again with POST /api/v1/pass-imports/{id}/check, then commit. |
| `IMPORT_NOT_FOUND` |  | Check the id with GET /api/v1/pass-imports. |
| `IMPORT_PASS_CHANGED` |  | Remove the pass on its own with POST /api/v1/passes/{id}/remove. |
| `IMPORT_PLAN_INVALID` |  | Fix the mapping entries named in issues and check again. |
| `IMPORT_ROW_UNRESERVED` |  | Retry the commit; if it persists, send the requestId to support. |
| `IMPORT_STATE` |  | Check its state with GET /api/v1/pass-imports/{id} and call the action that state allows. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVALID_INPUT` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `JOIN_NOT_READY` |  | Publish the template, then enable the link with PUT /api/v1/join-links/{templateId}. |
| `MATCH_NEEDS_TEMPLATE` |  | Send orgId and templateId with the input filter. |
| `MEMBER_PHOTO_CHANGED` |  | Fetch the pass with GET /api/v1/passes/{id} and save the photo again. |
| `MEMBER_PHOTO_DIMENSIONS` |  | Crop the photo to a 270 by 270 pixel square and upload it again. |
| `MEMBER_PHOTO_ENCODING` |  | Send the photo as a PNG or JPEG file. |
| `MEMBER_PHOTO_NOT_FOUND` |  | Add one with PUT /api/v1/passes/{id}/member-photo. |
| `MEMBER_PHOTO_STYLE` |  | Use a template of that style, or remove the strip image. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `MODE_MISMATCH` |  | Use objects and a key of the same mode. |
| `NEW_CODE_UNSUPPORTED` |  | Reissue the pass with POST /api/v1/passes/bulk-reissue instead of requesting a new code. |
| `NO_RECIPIENT` |  | Set the holder's email with PATCH /api/v1/passes/{id}, then send again. |
| `ORG_ACCESS_CHANGED` |  | Check access with GET /api/v1/api-keys/me, then send the request again. |
| `ORG_FORBIDDEN` |  | Use a key scoped to this organization, or a platform key for platform-wide lists. |
| `ORG_MIXED` |  | Send ids from one organization per request. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_REQUIRED` |  | Send orgId with the request, or use a key scoped to one organization. |
| `PASS_CONFLICT` |  | Fetch the pass with GET /api/v1/passes/{id} and send the request again. |
| `PASS_CONNECTION_MISMATCH` |  | Link it with PUT /api/v1/passes/{id}/connection, then send the request again. |
| `PASS_FILE_MISSING` |  | Rebuild it with POST /api/v1/passes/{id}/refresh. |
| `PASS_INPUT_INVALID` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `PASS_INVALID` |  | Fix the problems named in issues in the template or inputs. |
| `PASS_NOT_ACTIVE` |  | Restore or unvoid the pass first, or use an active one. |
| `PASS_NOT_FOUND` |  | Check the id with GET /api/v1/passes and the key's mode. |
| `PASS_REF_TAKEN` |  | Use a different ref, or update the existing pass. |
| `PASS_REISSUE_REQUIRED` |  | Reissue it with POST /api/v1/passes/bulk-reissue. |
| `PASS_REMOVED` |  | Restore it with POST /api/v1/passes/{id}/restore, then send the request again. |
| `PASS_TRANSFER_NOT_FOUND` |  | Check the transfer id. |
| `PASS_TRANSFER_PENDING` |  | Try again shortly. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `RECIPIENT_NOT_HOLDER` |  | Send to the holder's email, or change it with PATCH /api/v1/passes/{id}. |
| `SCAN_EVENT_NOT_FOUND` |  | Check the event id with GET /api/v1/scan/events. |
| `SCAN_WINDOW_INVALID` |  | Set an end after the start, or fix the template's dates. |
| `SERIAL_TAKEN` |  | Send a different serial, or leave it out to have one generated. |
| `SESSION_REQUIRED` |  | Do it in the console, or sign in as the account that started it. |
| `STAMPS_ABOVE_MAX` |  | Raise the template's stamp maximum, or redeem stamps first. |
| `STAMPS_CARD_FULL` |  | Redeem the reward, then add stamps. |
| `STAMPS_NONE` |  | Use a template with stamps. |
| `STAMPS_NO_REWARD` |  | Add stamps until the card is full, then redeem. |
| `TEMPLATE_NOT_FOUND` |  | Check the id with GET /api/v1/templates and the key's mode. |
| `TEMPLATE_RELEASE_CONFLICT` |  | Send the request again to use the current release. |
| `TEMPLATE_RELEASE_REQUIRED` |  | Approve a release with POST /api/v1/templates/{id}/candidates/{candidateId}/approve. |
| `TERM_MANAGED` |  | Change the term in the connected system. |
| `TERM_NONE` |  | Renew only passes whose template defines a term. |
| `TERM_NOT_STARTED` |  | Renew after the term starts. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |
| `VERSION_NOT_FOUND` |  | Check the version with GET /api/v1/passes/{id}. |
| `VERSION_PURGED` |  | Request a newer version. |
| `WORKFLOW_START` |  | Send the request again. |

```sh
curl -X GET "https://passbook.mobile/api/v1/pass-imports" \
  -H "Authorization: Bearer $PASSBOOK_KEY"
```

## Start an import from a file or a sheet link; checks it when a plan is known {#create}

`POST /api/v1/pass-imports`

Scopes: `passes:write`. SDK name: `pb.passImports.create`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `templateId` | body | string · max 64 | yes |  |
| `source` | body | object \| object | yes |  |
| `plan` | body | object |  |  |
| · `mapping` | body | object | yes |  |
| · `holderEmail` | body | object \| null | yes |  |
| · `externalId` | body | object \| null | yes |  |
| · `match` | body | "externalId" \| "email" \| "none" | yes |  |
| · `keepManual` | body | boolean |  |  |
| · `save` | body | boolean |  |  |

Returns `201`.

| Code | Status | Fix |
| --- | --- | --- |
| `ASSET_DIMENSIONS` |  | Resize the image to the size named in issues and upload it again. |
| `ASSET_NOT_FOUND` |  | Check the image name or id and that it belongs to this organization. |
| `ASSET_NOT_PNG` |  | Re-export the image as a standard RGB or RGBA PNG and upload it again. |
| `ASSET_SIZE` |  | Compress the image below 1 MB and upload it again. |
| `ASSET_SLOT` |  | Use a slot name from the pass type's image slots in the request path. |
| `BULK_RUN_ACTIVE` |  | Wait for the running job to finish, then start the new one. |
| `BUNDLE_TOO_LARGE` |  | Split the passes across smaller bundles. |
| `CONNECTION_ORG` |  | Use a connection id from your own organization's GET /api/v1/connections. |
| `CONNECTION_TRANSFER_PENDING` |  | Wait for the transfer to finish, then send the request again. |
| `CREATE_STALE` |  | Look the pass up by externalId with GET /api/v1/passes and update it instead of creating it again. |
| `CREDENTIAL_REF_KEYSET_CONFIG_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `CREDENTIAL_REF_KEYSET_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `DELIVERY_STALE` |  | Review the recipient and try again. |
| `DEVICE_TOKEN_UNAVAILABLE` |  | Retry the request; if it persists, send the requestId to support. |
| `EMAIL_INVALID` |  | Send a valid address in the email field. |
| `EXTERNAL_ID_TAKEN` |  | Send a new externalId, or PATCH the existing pass. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDEMPOTENCY_IN_PROGRESS` |  | Wait a moment and resend the identical request. |
| `IDEMPOTENCY_KEY_INVALID` |  | Send a unique string of 1 to 200 characters, such as a UUID. |
| `IDEMPOTENCY_KEY_REUSED` |  | Use a new key for a new request; resend the identical request to replay. |
| `IF_MATCH_INVALID` |  | Send the version from the last GET, for example If-Match: 3. |
| `IMPORT_BUSY` |  | Wait for it to finish with GET /api/v1/pass-imports/{id}, then retry. |
| `IMPORT_COLUMN_MISSING` |  | Add the column to the file, or change the mapping, then check again. |
| `IMPORT_EXPIRED` |  | Upload the file again with POST /api/v1/pass-imports. |
| `IMPORT_FILE_GONE` |  | Upload it again. |
| `IMPORT_HAS_ERRORS` |  | Fix the rows listed in GET /api/v1/pass-imports/{id}/errors.csv, or skip them, then commit again. |
| `IMPORT_HEADER_TOO_LONG` |  | Shorten the header and upload the file again. |
| `IMPORT_ID_TAKEN` |  | Check the import again with POST /api/v1/pass-imports/{id}/check, then commit. |
| `IMPORT_NOT_FOUND` |  | Check the id with GET /api/v1/pass-imports. |
| `IMPORT_PASS_CHANGED` |  | Remove the pass on its own with POST /api/v1/passes/{id}/remove. |
| `IMPORT_PLAN_INVALID` |  | Fix the mapping entries named in issues and check again. |
| `IMPORT_ROW_UNRESERVED` |  | Retry the commit; if it persists, send the requestId to support. |
| `IMPORT_STATE` |  | Check its state with GET /api/v1/pass-imports/{id} and call the action that state allows. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVALID_INPUT` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `JOIN_NOT_READY` |  | Publish the template, then enable the link with PUT /api/v1/join-links/{templateId}. |
| `MATCH_NEEDS_TEMPLATE` |  | Send orgId and templateId with the input filter. |
| `MEMBER_PHOTO_CHANGED` |  | Fetch the pass with GET /api/v1/passes/{id} and save the photo again. |
| `MEMBER_PHOTO_DIMENSIONS` |  | Crop the photo to a 270 by 270 pixel square and upload it again. |
| `MEMBER_PHOTO_ENCODING` |  | Send the photo as a PNG or JPEG file. |
| `MEMBER_PHOTO_NOT_FOUND` |  | Add one with PUT /api/v1/passes/{id}/member-photo. |
| `MEMBER_PHOTO_STYLE` |  | Use a template of that style, or remove the strip image. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `MODE_MISMATCH` |  | Use objects and a key of the same mode. |
| `NEW_CODE_UNSUPPORTED` |  | Reissue the pass with POST /api/v1/passes/bulk-reissue instead of requesting a new code. |
| `NO_RECIPIENT` |  | Set the holder's email with PATCH /api/v1/passes/{id}, then send again. |
| `ORG_ACCESS_CHANGED` |  | Check access with GET /api/v1/api-keys/me, then send the request again. |
| `ORG_FORBIDDEN` |  | Use a key scoped to this organization, or a platform key for platform-wide lists. |
| `ORG_MIXED` |  | Send ids from one organization per request. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_REQUIRED` |  | Send orgId with the request, or use a key scoped to one organization. |
| `PASS_CONFLICT` |  | Fetch the pass with GET /api/v1/passes/{id} and send the request again. |
| `PASS_CONNECTION_MISMATCH` |  | Link it with PUT /api/v1/passes/{id}/connection, then send the request again. |
| `PASS_FILE_MISSING` |  | Rebuild it with POST /api/v1/passes/{id}/refresh. |
| `PASS_INPUT_INVALID` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `PASS_INVALID` |  | Fix the problems named in issues in the template or inputs. |
| `PASS_NOT_ACTIVE` |  | Restore or unvoid the pass first, or use an active one. |
| `PASS_NOT_FOUND` |  | Check the id with GET /api/v1/passes and the key's mode. |
| `PASS_REF_TAKEN` |  | Use a different ref, or update the existing pass. |
| `PASS_REISSUE_REQUIRED` |  | Reissue it with POST /api/v1/passes/bulk-reissue. |
| `PASS_REMOVED` |  | Restore it with POST /api/v1/passes/{id}/restore, then send the request again. |
| `PASS_TRANSFER_NOT_FOUND` |  | Check the transfer id. |
| `PASS_TRANSFER_PENDING` |  | Try again shortly. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `RECIPIENT_NOT_HOLDER` |  | Send to the holder's email, or change it with PATCH /api/v1/passes/{id}. |
| `SCAN_EVENT_NOT_FOUND` |  | Check the event id with GET /api/v1/scan/events. |
| `SCAN_WINDOW_INVALID` |  | Set an end after the start, or fix the template's dates. |
| `SERIAL_TAKEN` |  | Send a different serial, or leave it out to have one generated. |
| `SESSION_REQUIRED` |  | Do it in the console, or sign in as the account that started it. |
| `STAMPS_ABOVE_MAX` |  | Raise the template's stamp maximum, or redeem stamps first. |
| `STAMPS_CARD_FULL` |  | Redeem the reward, then add stamps. |
| `STAMPS_NONE` |  | Use a template with stamps. |
| `STAMPS_NO_REWARD` |  | Add stamps until the card is full, then redeem. |
| `TEMPLATE_NOT_FOUND` |  | Check the id with GET /api/v1/templates and the key's mode. |
| `TEMPLATE_RELEASE_CONFLICT` |  | Send the request again to use the current release. |
| `TEMPLATE_RELEASE_REQUIRED` |  | Approve a release with POST /api/v1/templates/{id}/candidates/{candidateId}/approve. |
| `TERM_MANAGED` |  | Change the term in the connected system. |
| `TERM_NONE` |  | Renew only passes whose template defines a term. |
| `TERM_NOT_STARTED` |  | Renew after the term starts. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |
| `VERSION_NOT_FOUND` |  | Check the version with GET /api/v1/passes/{id}. |
| `VERSION_PURGED` |  | Request a newer version. |
| `WORKFLOW_START` |  | Send the request again. |

```sh
curl -X POST "https://passbook.mobile/api/v1/pass-imports" \
  -H "Authorization: Bearer $PASSBOOK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "templateId": "0193a1b2-7c00-7000-8000-0000000000b1",
  "source": {
    "kind": "file",
    "name": "Example",
    "csv": "Example"
  }
}'
```

## Get an import {#retrieve}

`GET /api/v1/pass-imports/{id}`

Scopes: `passes:read`. SDK name: `pb.passImports.retrieve`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string · max 64 | yes |  |

Returns `200`.

| Code | Status | Fix |
| --- | --- | --- |
| `ASSET_DIMENSIONS` |  | Resize the image to the size named in issues and upload it again. |
| `ASSET_NOT_FOUND` |  | Check the image name or id and that it belongs to this organization. |
| `ASSET_NOT_PNG` |  | Re-export the image as a standard RGB or RGBA PNG and upload it again. |
| `ASSET_SIZE` |  | Compress the image below 1 MB and upload it again. |
| `ASSET_SLOT` |  | Use a slot name from the pass type's image slots in the request path. |
| `BULK_RUN_ACTIVE` |  | Wait for the running job to finish, then start the new one. |
| `BUNDLE_TOO_LARGE` |  | Split the passes across smaller bundles. |
| `CONNECTION_ORG` |  | Use a connection id from your own organization's GET /api/v1/connections. |
| `CONNECTION_TRANSFER_PENDING` |  | Wait for the transfer to finish, then send the request again. |
| `CREATE_STALE` |  | Look the pass up by externalId with GET /api/v1/passes and update it instead of creating it again. |
| `CREDENTIAL_REF_KEYSET_CONFIG_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `CREDENTIAL_REF_KEYSET_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `DELIVERY_STALE` |  | Review the recipient and try again. |
| `DEVICE_TOKEN_UNAVAILABLE` |  | Retry the request; if it persists, send the requestId to support. |
| `EMAIL_INVALID` |  | Send a valid address in the email field. |
| `EXTERNAL_ID_TAKEN` |  | Send a new externalId, or PATCH the existing pass. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDEMPOTENCY_IN_PROGRESS` |  | Wait a moment and resend the identical request. |
| `IDEMPOTENCY_KEY_INVALID` |  | Send a unique string of 1 to 200 characters, such as a UUID. |
| `IDEMPOTENCY_KEY_REUSED` |  | Use a new key for a new request; resend the identical request to replay. |
| `IF_MATCH_INVALID` |  | Send the version from the last GET, for example If-Match: 3. |
| `IMPORT_BUSY` |  | Wait for it to finish with GET /api/v1/pass-imports/{id}, then retry. |
| `IMPORT_COLUMN_MISSING` |  | Add the column to the file, or change the mapping, then check again. |
| `IMPORT_EXPIRED` |  | Upload the file again with POST /api/v1/pass-imports. |
| `IMPORT_FILE_GONE` |  | Upload it again. |
| `IMPORT_HAS_ERRORS` |  | Fix the rows listed in GET /api/v1/pass-imports/{id}/errors.csv, or skip them, then commit again. |
| `IMPORT_HEADER_TOO_LONG` |  | Shorten the header and upload the file again. |
| `IMPORT_ID_TAKEN` |  | Check the import again with POST /api/v1/pass-imports/{id}/check, then commit. |
| `IMPORT_NOT_FOUND` |  | Check the id with GET /api/v1/pass-imports. |
| `IMPORT_PASS_CHANGED` |  | Remove the pass on its own with POST /api/v1/passes/{id}/remove. |
| `IMPORT_PLAN_INVALID` |  | Fix the mapping entries named in issues and check again. |
| `IMPORT_ROW_UNRESERVED` |  | Retry the commit; if it persists, send the requestId to support. |
| `IMPORT_STATE` |  | Check its state with GET /api/v1/pass-imports/{id} and call the action that state allows. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVALID_INPUT` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `JOIN_NOT_READY` |  | Publish the template, then enable the link with PUT /api/v1/join-links/{templateId}. |
| `MATCH_NEEDS_TEMPLATE` |  | Send orgId and templateId with the input filter. |
| `MEMBER_PHOTO_CHANGED` |  | Fetch the pass with GET /api/v1/passes/{id} and save the photo again. |
| `MEMBER_PHOTO_DIMENSIONS` |  | Crop the photo to a 270 by 270 pixel square and upload it again. |
| `MEMBER_PHOTO_ENCODING` |  | Send the photo as a PNG or JPEG file. |
| `MEMBER_PHOTO_NOT_FOUND` |  | Add one with PUT /api/v1/passes/{id}/member-photo. |
| `MEMBER_PHOTO_STYLE` |  | Use a template of that style, or remove the strip image. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `MODE_MISMATCH` |  | Use objects and a key of the same mode. |
| `NEW_CODE_UNSUPPORTED` |  | Reissue the pass with POST /api/v1/passes/bulk-reissue instead of requesting a new code. |
| `NOT_FOUND` |  | Check the id, and that the key's mode (test or live) matches the object. |
| `NO_RECIPIENT` |  | Set the holder's email with PATCH /api/v1/passes/{id}, then send again. |
| `ORG_ACCESS_CHANGED` |  | Check access with GET /api/v1/api-keys/me, then send the request again. |
| `ORG_FORBIDDEN` |  | Use a key scoped to this organization, or a platform key for platform-wide lists. |
| `ORG_MIXED` |  | Send ids from one organization per request. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_REQUIRED` |  | Send orgId with the request, or use a key scoped to one organization. |
| `PASS_CONFLICT` |  | Fetch the pass with GET /api/v1/passes/{id} and send the request again. |
| `PASS_CONNECTION_MISMATCH` |  | Link it with PUT /api/v1/passes/{id}/connection, then send the request again. |
| `PASS_FILE_MISSING` |  | Rebuild it with POST /api/v1/passes/{id}/refresh. |
| `PASS_INPUT_INVALID` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `PASS_INVALID` |  | Fix the problems named in issues in the template or inputs. |
| `PASS_NOT_ACTIVE` |  | Restore or unvoid the pass first, or use an active one. |
| `PASS_NOT_FOUND` |  | Check the id with GET /api/v1/passes and the key's mode. |
| `PASS_REF_TAKEN` |  | Use a different ref, or update the existing pass. |
| `PASS_REISSUE_REQUIRED` |  | Reissue it with POST /api/v1/passes/bulk-reissue. |
| `PASS_REMOVED` |  | Restore it with POST /api/v1/passes/{id}/restore, then send the request again. |
| `PASS_TRANSFER_NOT_FOUND` |  | Check the transfer id. |
| `PASS_TRANSFER_PENDING` |  | Try again shortly. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `RECIPIENT_NOT_HOLDER` |  | Send to the holder's email, or change it with PATCH /api/v1/passes/{id}. |
| `SCAN_EVENT_NOT_FOUND` |  | Check the event id with GET /api/v1/scan/events. |
| `SCAN_WINDOW_INVALID` |  | Set an end after the start, or fix the template's dates. |
| `SERIAL_TAKEN` |  | Send a different serial, or leave it out to have one generated. |
| `SESSION_REQUIRED` |  | Do it in the console, or sign in as the account that started it. |
| `STAMPS_ABOVE_MAX` |  | Raise the template's stamp maximum, or redeem stamps first. |
| `STAMPS_CARD_FULL` |  | Redeem the reward, then add stamps. |
| `STAMPS_NONE` |  | Use a template with stamps. |
| `STAMPS_NO_REWARD` |  | Add stamps until the card is full, then redeem. |
| `TEMPLATE_NOT_FOUND` |  | Check the id with GET /api/v1/templates and the key's mode. |
| `TEMPLATE_RELEASE_CONFLICT` |  | Send the request again to use the current release. |
| `TEMPLATE_RELEASE_REQUIRED` |  | Approve a release with POST /api/v1/templates/{id}/candidates/{candidateId}/approve. |
| `TERM_MANAGED` |  | Change the term in the connected system. |
| `TERM_NONE` |  | Renew only passes whose template defines a term. |
| `TERM_NOT_STARTED` |  | Renew after the term starts. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |
| `VERSION_NOT_FOUND` |  | Check the version with GET /api/v1/passes/{id}. |
| `VERSION_PURGED` |  | Request a newer version. |
| `WORKFLOW_START` |  | Send the request again. |

```sh
curl -X GET "https://passbook.mobile/api/v1/pass-imports/0193a1b2-7c00-7000-8000-0000000000e1" \
  -H "Authorization: Bearer $PASSBOOK_KEY"
```

## Discard a draft that is not committing {#delete}

`DELETE /api/v1/pass-imports/{id}`

Scopes: `passes:write`. SDK name: `pb.passImports.delete`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string · max 64 | yes |  |

Returns `200`.

| Code | Status | Fix |
| --- | --- | --- |
| `ASSET_DIMENSIONS` |  | Resize the image to the size named in issues and upload it again. |
| `ASSET_NOT_FOUND` |  | Check the image name or id and that it belongs to this organization. |
| `ASSET_NOT_PNG` |  | Re-export the image as a standard RGB or RGBA PNG and upload it again. |
| `ASSET_SIZE` |  | Compress the image below 1 MB and upload it again. |
| `ASSET_SLOT` |  | Use a slot name from the pass type's image slots in the request path. |
| `BULK_RUN_ACTIVE` |  | Wait for the running job to finish, then start the new one. |
| `BUNDLE_TOO_LARGE` |  | Split the passes across smaller bundles. |
| `CONNECTION_ORG` |  | Use a connection id from your own organization's GET /api/v1/connections. |
| `CONNECTION_TRANSFER_PENDING` |  | Wait for the transfer to finish, then send the request again. |
| `CREATE_STALE` |  | Look the pass up by externalId with GET /api/v1/passes and update it instead of creating it again. |
| `CREDENTIAL_REF_KEYSET_CONFIG_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `CREDENTIAL_REF_KEYSET_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `DELIVERY_STALE` |  | Review the recipient and try again. |
| `DEVICE_TOKEN_UNAVAILABLE` |  | Retry the request; if it persists, send the requestId to support. |
| `EMAIL_INVALID` |  | Send a valid address in the email field. |
| `EXTERNAL_ID_TAKEN` |  | Send a new externalId, or PATCH the existing pass. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDEMPOTENCY_IN_PROGRESS` |  | Wait a moment and resend the identical request. |
| `IDEMPOTENCY_KEY_INVALID` |  | Send a unique string of 1 to 200 characters, such as a UUID. |
| `IDEMPOTENCY_KEY_REUSED` |  | Use a new key for a new request; resend the identical request to replay. |
| `IF_MATCH_INVALID` |  | Send the version from the last GET, for example If-Match: 3. |
| `IMPORT_BUSY` |  | Wait for it to finish with GET /api/v1/pass-imports/{id}, then retry. |
| `IMPORT_COLUMN_MISSING` |  | Add the column to the file, or change the mapping, then check again. |
| `IMPORT_EXPIRED` |  | Upload the file again with POST /api/v1/pass-imports. |
| `IMPORT_FILE_GONE` |  | Upload it again. |
| `IMPORT_HAS_ERRORS` |  | Fix the rows listed in GET /api/v1/pass-imports/{id}/errors.csv, or skip them, then commit again. |
| `IMPORT_HEADER_TOO_LONG` |  | Shorten the header and upload the file again. |
| `IMPORT_ID_TAKEN` |  | Check the import again with POST /api/v1/pass-imports/{id}/check, then commit. |
| `IMPORT_NOT_FOUND` |  | Check the id with GET /api/v1/pass-imports. |
| `IMPORT_PASS_CHANGED` |  | Remove the pass on its own with POST /api/v1/passes/{id}/remove. |
| `IMPORT_PLAN_INVALID` |  | Fix the mapping entries named in issues and check again. |
| `IMPORT_ROW_UNRESERVED` |  | Retry the commit; if it persists, send the requestId to support. |
| `IMPORT_STATE` |  | Check its state with GET /api/v1/pass-imports/{id} and call the action that state allows. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVALID_INPUT` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `JOIN_NOT_READY` |  | Publish the template, then enable the link with PUT /api/v1/join-links/{templateId}. |
| `MATCH_NEEDS_TEMPLATE` |  | Send orgId and templateId with the input filter. |
| `MEMBER_PHOTO_CHANGED` |  | Fetch the pass with GET /api/v1/passes/{id} and save the photo again. |
| `MEMBER_PHOTO_DIMENSIONS` |  | Crop the photo to a 270 by 270 pixel square and upload it again. |
| `MEMBER_PHOTO_ENCODING` |  | Send the photo as a PNG or JPEG file. |
| `MEMBER_PHOTO_NOT_FOUND` |  | Add one with PUT /api/v1/passes/{id}/member-photo. |
| `MEMBER_PHOTO_STYLE` |  | Use a template of that style, or remove the strip image. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `MODE_MISMATCH` |  | Use objects and a key of the same mode. |
| `NEW_CODE_UNSUPPORTED` |  | Reissue the pass with POST /api/v1/passes/bulk-reissue instead of requesting a new code. |
| `NOT_FOUND` |  | Check the id, and that the key's mode (test or live) matches the object. |
| `NO_RECIPIENT` |  | Set the holder's email with PATCH /api/v1/passes/{id}, then send again. |
| `ORG_ACCESS_CHANGED` |  | Check access with GET /api/v1/api-keys/me, then send the request again. |
| `ORG_FORBIDDEN` |  | Use a key scoped to this organization, or a platform key for platform-wide lists. |
| `ORG_MIXED` |  | Send ids from one organization per request. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_REQUIRED` |  | Send orgId with the request, or use a key scoped to one organization. |
| `PASS_CONFLICT` |  | Fetch the pass with GET /api/v1/passes/{id} and send the request again. |
| `PASS_CONNECTION_MISMATCH` |  | Link it with PUT /api/v1/passes/{id}/connection, then send the request again. |
| `PASS_FILE_MISSING` |  | Rebuild it with POST /api/v1/passes/{id}/refresh. |
| `PASS_INPUT_INVALID` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `PASS_INVALID` |  | Fix the problems named in issues in the template or inputs. |
| `PASS_NOT_ACTIVE` |  | Restore or unvoid the pass first, or use an active one. |
| `PASS_NOT_FOUND` |  | Check the id with GET /api/v1/passes and the key's mode. |
| `PASS_REF_TAKEN` |  | Use a different ref, or update the existing pass. |
| `PASS_REISSUE_REQUIRED` |  | Reissue it with POST /api/v1/passes/bulk-reissue. |
| `PASS_REMOVED` |  | Restore it with POST /api/v1/passes/{id}/restore, then send the request again. |
| `PASS_TRANSFER_NOT_FOUND` |  | Check the transfer id. |
| `PASS_TRANSFER_PENDING` |  | Try again shortly. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `RECIPIENT_NOT_HOLDER` |  | Send to the holder's email, or change it with PATCH /api/v1/passes/{id}. |
| `SCAN_EVENT_NOT_FOUND` |  | Check the event id with GET /api/v1/scan/events. |
| `SCAN_WINDOW_INVALID` |  | Set an end after the start, or fix the template's dates. |
| `SERIAL_TAKEN` |  | Send a different serial, or leave it out to have one generated. |
| `SESSION_REQUIRED` |  | Do it in the console, or sign in as the account that started it. |
| `STAMPS_ABOVE_MAX` |  | Raise the template's stamp maximum, or redeem stamps first. |
| `STAMPS_CARD_FULL` |  | Redeem the reward, then add stamps. |
| `STAMPS_NONE` |  | Use a template with stamps. |
| `STAMPS_NO_REWARD` |  | Add stamps until the card is full, then redeem. |
| `TEMPLATE_NOT_FOUND` |  | Check the id with GET /api/v1/templates and the key's mode. |
| `TEMPLATE_RELEASE_CONFLICT` |  | Send the request again to use the current release. |
| `TEMPLATE_RELEASE_REQUIRED` |  | Approve a release with POST /api/v1/templates/{id}/candidates/{candidateId}/approve. |
| `TERM_MANAGED` |  | Change the term in the connected system. |
| `TERM_NONE` |  | Renew only passes whose template defines a term. |
| `TERM_NOT_STARTED` |  | Renew after the term starts. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |
| `VERSION_NOT_FOUND` |  | Check the version with GET /api/v1/passes/{id}. |
| `VERSION_PURGED` |  | Request a newer version. |
| `WORKFLOW_START` |  | Send the request again. |

```sh
curl -X DELETE "https://passbook.mobile/api/v1/pass-imports/0193a1b2-7c00-7000-8000-0000000000e1" \
  -H "Authorization: Bearer $PASSBOOK_KEY"
```

## Check the file against a column mapping {#check}

`POST /api/v1/pass-imports/{id}/check`

Scopes: `passes:write`. SDK name: `pb.passImports.check`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string · max 64 | yes |  |
| `plan` | body | object | yes |  |
| · `mapping` | body | object | yes |  |
| · `holderEmail` | body | object \| null | yes |  |
| · `externalId` | body | object \| null | yes |  |
| · `match` | body | "externalId" \| "email" \| "none" | yes |  |
| · `keepManual` | body | boolean |  |  |
| · `save` | body | boolean |  |  |

Returns `200`.

| Code | Status | Fix |
| --- | --- | --- |
| `ASSET_DIMENSIONS` |  | Resize the image to the size named in issues and upload it again. |
| `ASSET_NOT_FOUND` |  | Check the image name or id and that it belongs to this organization. |
| `ASSET_NOT_PNG` |  | Re-export the image as a standard RGB or RGBA PNG and upload it again. |
| `ASSET_SIZE` |  | Compress the image below 1 MB and upload it again. |
| `ASSET_SLOT` |  | Use a slot name from the pass type's image slots in the request path. |
| `BULK_RUN_ACTIVE` |  | Wait for the running job to finish, then start the new one. |
| `BUNDLE_TOO_LARGE` |  | Split the passes across smaller bundles. |
| `CONNECTION_ORG` |  | Use a connection id from your own organization's GET /api/v1/connections. |
| `CONNECTION_TRANSFER_PENDING` |  | Wait for the transfer to finish, then send the request again. |
| `CREATE_STALE` |  | Look the pass up by externalId with GET /api/v1/passes and update it instead of creating it again. |
| `CREDENTIAL_REF_KEYSET_CONFIG_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `CREDENTIAL_REF_KEYSET_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `DELIVERY_STALE` |  | Review the recipient and try again. |
| `DEVICE_TOKEN_UNAVAILABLE` |  | Retry the request; if it persists, send the requestId to support. |
| `EMAIL_INVALID` |  | Send a valid address in the email field. |
| `EXTERNAL_ID_TAKEN` |  | Send a new externalId, or PATCH the existing pass. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDEMPOTENCY_IN_PROGRESS` |  | Wait a moment and resend the identical request. |
| `IDEMPOTENCY_KEY_INVALID` |  | Send a unique string of 1 to 200 characters, such as a UUID. |
| `IDEMPOTENCY_KEY_REUSED` |  | Use a new key for a new request; resend the identical request to replay. |
| `IF_MATCH_INVALID` |  | Send the version from the last GET, for example If-Match: 3. |
| `IMPORT_BUSY` |  | Wait for it to finish with GET /api/v1/pass-imports/{id}, then retry. |
| `IMPORT_COLUMN_MISSING` |  | Add the column to the file, or change the mapping, then check again. |
| `IMPORT_EXPIRED` |  | Upload the file again with POST /api/v1/pass-imports. |
| `IMPORT_FILE_GONE` |  | Upload it again. |
| `IMPORT_HAS_ERRORS` |  | Fix the rows listed in GET /api/v1/pass-imports/{id}/errors.csv, or skip them, then commit again. |
| `IMPORT_HEADER_TOO_LONG` |  | Shorten the header and upload the file again. |
| `IMPORT_ID_TAKEN` |  | Check the import again with POST /api/v1/pass-imports/{id}/check, then commit. |
| `IMPORT_NOT_FOUND` |  | Check the id with GET /api/v1/pass-imports. |
| `IMPORT_PASS_CHANGED` |  | Remove the pass on its own with POST /api/v1/passes/{id}/remove. |
| `IMPORT_PLAN_INVALID` |  | Fix the mapping entries named in issues and check again. |
| `IMPORT_ROW_UNRESERVED` |  | Retry the commit; if it persists, send the requestId to support. |
| `IMPORT_STATE` |  | Check its state with GET /api/v1/pass-imports/{id} and call the action that state allows. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVALID_INPUT` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `JOIN_NOT_READY` |  | Publish the template, then enable the link with PUT /api/v1/join-links/{templateId}. |
| `MATCH_NEEDS_TEMPLATE` |  | Send orgId and templateId with the input filter. |
| `MEMBER_PHOTO_CHANGED` |  | Fetch the pass with GET /api/v1/passes/{id} and save the photo again. |
| `MEMBER_PHOTO_DIMENSIONS` |  | Crop the photo to a 270 by 270 pixel square and upload it again. |
| `MEMBER_PHOTO_ENCODING` |  | Send the photo as a PNG or JPEG file. |
| `MEMBER_PHOTO_NOT_FOUND` |  | Add one with PUT /api/v1/passes/{id}/member-photo. |
| `MEMBER_PHOTO_STYLE` |  | Use a template of that style, or remove the strip image. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `MODE_MISMATCH` |  | Use objects and a key of the same mode. |
| `NEW_CODE_UNSUPPORTED` |  | Reissue the pass with POST /api/v1/passes/bulk-reissue instead of requesting a new code. |
| `NOT_FOUND` |  | Check the id, and that the key's mode (test or live) matches the object. |
| `NO_RECIPIENT` |  | Set the holder's email with PATCH /api/v1/passes/{id}, then send again. |
| `ORG_ACCESS_CHANGED` |  | Check access with GET /api/v1/api-keys/me, then send the request again. |
| `ORG_FORBIDDEN` |  | Use a key scoped to this organization, or a platform key for platform-wide lists. |
| `ORG_MIXED` |  | Send ids from one organization per request. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_REQUIRED` |  | Send orgId with the request, or use a key scoped to one organization. |
| `PASS_CONFLICT` |  | Fetch the pass with GET /api/v1/passes/{id} and send the request again. |
| `PASS_CONNECTION_MISMATCH` |  | Link it with PUT /api/v1/passes/{id}/connection, then send the request again. |
| `PASS_FILE_MISSING` |  | Rebuild it with POST /api/v1/passes/{id}/refresh. |
| `PASS_INPUT_INVALID` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `PASS_INVALID` |  | Fix the problems named in issues in the template or inputs. |
| `PASS_NOT_ACTIVE` |  | Restore or unvoid the pass first, or use an active one. |
| `PASS_NOT_FOUND` |  | Check the id with GET /api/v1/passes and the key's mode. |
| `PASS_REF_TAKEN` |  | Use a different ref, or update the existing pass. |
| `PASS_REISSUE_REQUIRED` |  | Reissue it with POST /api/v1/passes/bulk-reissue. |
| `PASS_REMOVED` |  | Restore it with POST /api/v1/passes/{id}/restore, then send the request again. |
| `PASS_TRANSFER_NOT_FOUND` |  | Check the transfer id. |
| `PASS_TRANSFER_PENDING` |  | Try again shortly. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `RECIPIENT_NOT_HOLDER` |  | Send to the holder's email, or change it with PATCH /api/v1/passes/{id}. |
| `SCAN_EVENT_NOT_FOUND` |  | Check the event id with GET /api/v1/scan/events. |
| `SCAN_WINDOW_INVALID` |  | Set an end after the start, or fix the template's dates. |
| `SERIAL_TAKEN` |  | Send a different serial, or leave it out to have one generated. |
| `SESSION_REQUIRED` |  | Do it in the console, or sign in as the account that started it. |
| `STAMPS_ABOVE_MAX` |  | Raise the template's stamp maximum, or redeem stamps first. |
| `STAMPS_CARD_FULL` |  | Redeem the reward, then add stamps. |
| `STAMPS_NONE` |  | Use a template with stamps. |
| `STAMPS_NO_REWARD` |  | Add stamps until the card is full, then redeem. |
| `TEMPLATE_NOT_FOUND` |  | Check the id with GET /api/v1/templates and the key's mode. |
| `TEMPLATE_RELEASE_CONFLICT` |  | Send the request again to use the current release. |
| `TEMPLATE_RELEASE_REQUIRED` |  | Approve a release with POST /api/v1/templates/{id}/candidates/{candidateId}/approve. |
| `TERM_MANAGED` |  | Change the term in the connected system. |
| `TERM_NONE` |  | Renew only passes whose template defines a term. |
| `TERM_NOT_STARTED` |  | Renew after the term starts. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |
| `VERSION_NOT_FOUND` |  | Check the version with GET /api/v1/passes/{id}. |
| `VERSION_PURGED` |  | Request a newer version. |
| `WORKFLOW_START` |  | Send the request again. |

```sh
curl -X POST "https://passbook.mobile/api/v1/pass-imports/0193a1b2-7c00-7000-8000-0000000000e1/check" \
  -H "Authorization: Bearer $PASSBOOK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "plan": {
    "mapping": {},
    "holderEmail": {
      "from": "Example"
    },
    "externalId": {
      "from": "Example"
    },
    "match": "externalId"
  }
}'
```

## Apply the checked rows: create the new passes and update the matched ones {#commit}

`POST /api/v1/pass-imports/{id}/commit`

Scopes: `passes:write`. SDK name: `pb.passImports.commit`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string · max 64 | yes |  |
| `skipInvalid` | body | boolean |  |  |
| `email` | body | boolean |  |  |

Returns `200`.

| Code | Status | Fix |
| --- | --- | --- |
| `ASSET_DIMENSIONS` |  | Resize the image to the size named in issues and upload it again. |
| `ASSET_NOT_FOUND` |  | Check the image name or id and that it belongs to this organization. |
| `ASSET_NOT_PNG` |  | Re-export the image as a standard RGB or RGBA PNG and upload it again. |
| `ASSET_SIZE` |  | Compress the image below 1 MB and upload it again. |
| `ASSET_SLOT` |  | Use a slot name from the pass type's image slots in the request path. |
| `BULK_RUN_ACTIVE` |  | Wait for the running job to finish, then start the new one. |
| `BUNDLE_TOO_LARGE` |  | Split the passes across smaller bundles. |
| `CONNECTION_ORG` |  | Use a connection id from your own organization's GET /api/v1/connections. |
| `CONNECTION_TRANSFER_PENDING` |  | Wait for the transfer to finish, then send the request again. |
| `CREATE_STALE` |  | Look the pass up by externalId with GET /api/v1/passes and update it instead of creating it again. |
| `CREDENTIAL_REF_KEYSET_CONFIG_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `CREDENTIAL_REF_KEYSET_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `DELIVERY_STALE` |  | Review the recipient and try again. |
| `DEVICE_TOKEN_UNAVAILABLE` |  | Retry the request; if it persists, send the requestId to support. |
| `EMAIL_INVALID` |  | Send a valid address in the email field. |
| `EXTERNAL_ID_TAKEN` |  | Send a new externalId, or PATCH the existing pass. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDEMPOTENCY_IN_PROGRESS` |  | Wait a moment and resend the identical request. |
| `IDEMPOTENCY_KEY_INVALID` |  | Send a unique string of 1 to 200 characters, such as a UUID. |
| `IDEMPOTENCY_KEY_REUSED` |  | Use a new key for a new request; resend the identical request to replay. |
| `IF_MATCH_INVALID` |  | Send the version from the last GET, for example If-Match: 3. |
| `IMPORT_BUSY` |  | Wait for it to finish with GET /api/v1/pass-imports/{id}, then retry. |
| `IMPORT_COLUMN_MISSING` |  | Add the column to the file, or change the mapping, then check again. |
| `IMPORT_EXPIRED` |  | Upload the file again with POST /api/v1/pass-imports. |
| `IMPORT_FILE_GONE` |  | Upload it again. |
| `IMPORT_HAS_ERRORS` |  | Fix the rows listed in GET /api/v1/pass-imports/{id}/errors.csv, or skip them, then commit again. |
| `IMPORT_HEADER_TOO_LONG` |  | Shorten the header and upload the file again. |
| `IMPORT_ID_TAKEN` |  | Check the import again with POST /api/v1/pass-imports/{id}/check, then commit. |
| `IMPORT_NOT_FOUND` |  | Check the id with GET /api/v1/pass-imports. |
| `IMPORT_PASS_CHANGED` |  | Remove the pass on its own with POST /api/v1/passes/{id}/remove. |
| `IMPORT_PLAN_INVALID` |  | Fix the mapping entries named in issues and check again. |
| `IMPORT_ROW_UNRESERVED` |  | Retry the commit; if it persists, send the requestId to support. |
| `IMPORT_STATE` |  | Check its state with GET /api/v1/pass-imports/{id} and call the action that state allows. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVALID_INPUT` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `JOIN_NOT_READY` |  | Publish the template, then enable the link with PUT /api/v1/join-links/{templateId}. |
| `MATCH_NEEDS_TEMPLATE` |  | Send orgId and templateId with the input filter. |
| `MEMBER_PHOTO_CHANGED` |  | Fetch the pass with GET /api/v1/passes/{id} and save the photo again. |
| `MEMBER_PHOTO_DIMENSIONS` |  | Crop the photo to a 270 by 270 pixel square and upload it again. |
| `MEMBER_PHOTO_ENCODING` |  | Send the photo as a PNG or JPEG file. |
| `MEMBER_PHOTO_NOT_FOUND` |  | Add one with PUT /api/v1/passes/{id}/member-photo. |
| `MEMBER_PHOTO_STYLE` |  | Use a template of that style, or remove the strip image. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `MODE_MISMATCH` |  | Use objects and a key of the same mode. |
| `NEW_CODE_UNSUPPORTED` |  | Reissue the pass with POST /api/v1/passes/bulk-reissue instead of requesting a new code. |
| `NOT_FOUND` |  | Check the id, and that the key's mode (test or live) matches the object. |
| `NO_RECIPIENT` |  | Set the holder's email with PATCH /api/v1/passes/{id}, then send again. |
| `ORG_ACCESS_CHANGED` |  | Check access with GET /api/v1/api-keys/me, then send the request again. |
| `ORG_FORBIDDEN` |  | Use a key scoped to this organization, or a platform key for platform-wide lists. |
| `ORG_MIXED` |  | Send ids from one organization per request. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_REQUIRED` |  | Send orgId with the request, or use a key scoped to one organization. |
| `PASS_CONFLICT` |  | Fetch the pass with GET /api/v1/passes/{id} and send the request again. |
| `PASS_CONNECTION_MISMATCH` |  | Link it with PUT /api/v1/passes/{id}/connection, then send the request again. |
| `PASS_FILE_MISSING` |  | Rebuild it with POST /api/v1/passes/{id}/refresh. |
| `PASS_INPUT_INVALID` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `PASS_INVALID` |  | Fix the problems named in issues in the template or inputs. |
| `PASS_NOT_ACTIVE` |  | Restore or unvoid the pass first, or use an active one. |
| `PASS_NOT_FOUND` |  | Check the id with GET /api/v1/passes and the key's mode. |
| `PASS_REF_TAKEN` |  | Use a different ref, or update the existing pass. |
| `PASS_REISSUE_REQUIRED` |  | Reissue it with POST /api/v1/passes/bulk-reissue. |
| `PASS_REMOVED` |  | Restore it with POST /api/v1/passes/{id}/restore, then send the request again. |
| `PASS_TRANSFER_NOT_FOUND` |  | Check the transfer id. |
| `PASS_TRANSFER_PENDING` |  | Try again shortly. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `RECIPIENT_NOT_HOLDER` |  | Send to the holder's email, or change it with PATCH /api/v1/passes/{id}. |
| `SCAN_EVENT_NOT_FOUND` |  | Check the event id with GET /api/v1/scan/events. |
| `SCAN_WINDOW_INVALID` |  | Set an end after the start, or fix the template's dates. |
| `SERIAL_TAKEN` |  | Send a different serial, or leave it out to have one generated. |
| `SESSION_REQUIRED` |  | Do it in the console, or sign in as the account that started it. |
| `STAMPS_ABOVE_MAX` |  | Raise the template's stamp maximum, or redeem stamps first. |
| `STAMPS_CARD_FULL` |  | Redeem the reward, then add stamps. |
| `STAMPS_NONE` |  | Use a template with stamps. |
| `STAMPS_NO_REWARD` |  | Add stamps until the card is full, then redeem. |
| `TEMPLATE_NOT_FOUND` |  | Check the id with GET /api/v1/templates and the key's mode. |
| `TEMPLATE_RELEASE_CONFLICT` |  | Send the request again to use the current release. |
| `TEMPLATE_RELEASE_REQUIRED` |  | Approve a release with POST /api/v1/templates/{id}/candidates/{candidateId}/approve. |
| `TERM_MANAGED` |  | Change the term in the connected system. |
| `TERM_NONE` |  | Renew only passes whose template defines a term. |
| `TERM_NOT_STARTED` |  | Renew after the term starts. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |
| `VERSION_NOT_FOUND` |  | Check the version with GET /api/v1/passes/{id}. |
| `VERSION_PURGED` |  | Request a newer version. |
| `WORKFLOW_START` |  | Send the request again. |

```sh
curl -X POST "https://passbook.mobile/api/v1/pass-imports/0193a1b2-7c00-7000-8000-0000000000e1/commit" \
  -H "Authorization: Bearer $PASSBOOK_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## The rows that failed the check, with a Problem column {#downloadErrors}

`GET /api/v1/pass-imports/{id}/errors.csv`

Scopes: `passes:read`. SDK name: `pb.passImports.downloadErrors`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string · max 64 | yes |  |

Returns `200`.

| Code | Status | Fix |
| --- | --- | --- |
| `ASSET_DIMENSIONS` |  | Resize the image to the size named in issues and upload it again. |
| `ASSET_NOT_FOUND` |  | Check the image name or id and that it belongs to this organization. |
| `ASSET_NOT_PNG` |  | Re-export the image as a standard RGB or RGBA PNG and upload it again. |
| `ASSET_SIZE` |  | Compress the image below 1 MB and upload it again. |
| `ASSET_SLOT` |  | Use a slot name from the pass type's image slots in the request path. |
| `BULK_RUN_ACTIVE` |  | Wait for the running job to finish, then start the new one. |
| `BUNDLE_TOO_LARGE` |  | Split the passes across smaller bundles. |
| `CONNECTION_ORG` |  | Use a connection id from your own organization's GET /api/v1/connections. |
| `CONNECTION_TRANSFER_PENDING` |  | Wait for the transfer to finish, then send the request again. |
| `CREATE_STALE` |  | Look the pass up by externalId with GET /api/v1/passes and update it instead of creating it again. |
| `CREDENTIAL_REF_KEYSET_CONFIG_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `CREDENTIAL_REF_KEYSET_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `DELIVERY_STALE` |  | Review the recipient and try again. |
| `DEVICE_TOKEN_UNAVAILABLE` |  | Retry the request; if it persists, send the requestId to support. |
| `EMAIL_INVALID` |  | Send a valid address in the email field. |
| `EXTERNAL_ID_TAKEN` |  | Send a new externalId, or PATCH the existing pass. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDEMPOTENCY_IN_PROGRESS` |  | Wait a moment and resend the identical request. |
| `IDEMPOTENCY_KEY_INVALID` |  | Send a unique string of 1 to 200 characters, such as a UUID. |
| `IDEMPOTENCY_KEY_REUSED` |  | Use a new key for a new request; resend the identical request to replay. |
| `IF_MATCH_INVALID` |  | Send the version from the last GET, for example If-Match: 3. |
| `IMPORT_BUSY` |  | Wait for it to finish with GET /api/v1/pass-imports/{id}, then retry. |
| `IMPORT_COLUMN_MISSING` |  | Add the column to the file, or change the mapping, then check again. |
| `IMPORT_EXPIRED` |  | Upload the file again with POST /api/v1/pass-imports. |
| `IMPORT_FILE_GONE` |  | Upload it again. |
| `IMPORT_HAS_ERRORS` |  | Fix the rows listed in GET /api/v1/pass-imports/{id}/errors.csv, or skip them, then commit again. |
| `IMPORT_HEADER_TOO_LONG` |  | Shorten the header and upload the file again. |
| `IMPORT_ID_TAKEN` |  | Check the import again with POST /api/v1/pass-imports/{id}/check, then commit. |
| `IMPORT_NOT_FOUND` |  | Check the id with GET /api/v1/pass-imports. |
| `IMPORT_PASS_CHANGED` |  | Remove the pass on its own with POST /api/v1/passes/{id}/remove. |
| `IMPORT_PLAN_INVALID` |  | Fix the mapping entries named in issues and check again. |
| `IMPORT_ROW_UNRESERVED` |  | Retry the commit; if it persists, send the requestId to support. |
| `IMPORT_STATE` |  | Check its state with GET /api/v1/pass-imports/{id} and call the action that state allows. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVALID_INPUT` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `JOIN_NOT_READY` |  | Publish the template, then enable the link with PUT /api/v1/join-links/{templateId}. |
| `MATCH_NEEDS_TEMPLATE` |  | Send orgId and templateId with the input filter. |
| `MEMBER_PHOTO_CHANGED` |  | Fetch the pass with GET /api/v1/passes/{id} and save the photo again. |
| `MEMBER_PHOTO_DIMENSIONS` |  | Crop the photo to a 270 by 270 pixel square and upload it again. |
| `MEMBER_PHOTO_ENCODING` |  | Send the photo as a PNG or JPEG file. |
| `MEMBER_PHOTO_NOT_FOUND` |  | Add one with PUT /api/v1/passes/{id}/member-photo. |
| `MEMBER_PHOTO_STYLE` |  | Use a template of that style, or remove the strip image. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `MODE_MISMATCH` |  | Use objects and a key of the same mode. |
| `NEW_CODE_UNSUPPORTED` |  | Reissue the pass with POST /api/v1/passes/bulk-reissue instead of requesting a new code. |
| `NOT_FOUND` |  | Check the id, and that the key's mode (test or live) matches the object. |
| `NO_RECIPIENT` |  | Set the holder's email with PATCH /api/v1/passes/{id}, then send again. |
| `ORG_ACCESS_CHANGED` |  | Check access with GET /api/v1/api-keys/me, then send the request again. |
| `ORG_FORBIDDEN` |  | Use a key scoped to this organization, or a platform key for platform-wide lists. |
| `ORG_MIXED` |  | Send ids from one organization per request. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_REQUIRED` |  | Send orgId with the request, or use a key scoped to one organization. |
| `PASS_CONFLICT` |  | Fetch the pass with GET /api/v1/passes/{id} and send the request again. |
| `PASS_CONNECTION_MISMATCH` |  | Link it with PUT /api/v1/passes/{id}/connection, then send the request again. |
| `PASS_FILE_MISSING` |  | Rebuild it with POST /api/v1/passes/{id}/refresh. |
| `PASS_INPUT_INVALID` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `PASS_INVALID` |  | Fix the problems named in issues in the template or inputs. |
| `PASS_NOT_ACTIVE` |  | Restore or unvoid the pass first, or use an active one. |
| `PASS_NOT_FOUND` |  | Check the id with GET /api/v1/passes and the key's mode. |
| `PASS_REF_TAKEN` |  | Use a different ref, or update the existing pass. |
| `PASS_REISSUE_REQUIRED` |  | Reissue it with POST /api/v1/passes/bulk-reissue. |
| `PASS_REMOVED` |  | Restore it with POST /api/v1/passes/{id}/restore, then send the request again. |
| `PASS_TRANSFER_NOT_FOUND` |  | Check the transfer id. |
| `PASS_TRANSFER_PENDING` |  | Try again shortly. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `RECIPIENT_NOT_HOLDER` |  | Send to the holder's email, or change it with PATCH /api/v1/passes/{id}. |
| `SCAN_EVENT_NOT_FOUND` |  | Check the event id with GET /api/v1/scan/events. |
| `SCAN_WINDOW_INVALID` |  | Set an end after the start, or fix the template's dates. |
| `SERIAL_TAKEN` |  | Send a different serial, or leave it out to have one generated. |
| `SESSION_REQUIRED` |  | Do it in the console, or sign in as the account that started it. |
| `STAMPS_ABOVE_MAX` |  | Raise the template's stamp maximum, or redeem stamps first. |
| `STAMPS_CARD_FULL` |  | Redeem the reward, then add stamps. |
| `STAMPS_NONE` |  | Use a template with stamps. |
| `STAMPS_NO_REWARD` |  | Add stamps until the card is full, then redeem. |
| `TEMPLATE_NOT_FOUND` |  | Check the id with GET /api/v1/templates and the key's mode. |
| `TEMPLATE_RELEASE_CONFLICT` |  | Send the request again to use the current release. |
| `TEMPLATE_RELEASE_REQUIRED` |  | Approve a release with POST /api/v1/templates/{id}/candidates/{candidateId}/approve. |
| `TERM_MANAGED` |  | Change the term in the connected system. |
| `TERM_NONE` |  | Renew only passes whose template defines a term. |
| `TERM_NOT_STARTED` |  | Renew after the term starts. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |
| `VERSION_NOT_FOUND` |  | Check the version with GET /api/v1/passes/{id}. |
| `VERSION_PURGED` |  | Request a newer version. |
| `WORKFLOW_START` |  | Send the request again. |

```sh
curl -X GET "https://passbook.mobile/api/v1/pass-imports/0193a1b2-7c00-7000-8000-0000000000e1/errors.csv" \
  -H "Authorization: Bearer $PASSBOOK_KEY"
```

## What happened to each row, with the pass and its links {#downloadResults}

`GET /api/v1/pass-imports/{id}/results.csv`

Scopes: `passes:write`. SDK name: `pb.passImports.downloadResults`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string · max 64 | yes |  |

Returns `200`.

| Code | Status | Fix |
| --- | --- | --- |
| `ASSET_DIMENSIONS` |  | Resize the image to the size named in issues and upload it again. |
| `ASSET_NOT_FOUND` |  | Check the image name or id and that it belongs to this organization. |
| `ASSET_NOT_PNG` |  | Re-export the image as a standard RGB or RGBA PNG and upload it again. |
| `ASSET_SIZE` |  | Compress the image below 1 MB and upload it again. |
| `ASSET_SLOT` |  | Use a slot name from the pass type's image slots in the request path. |
| `BULK_RUN_ACTIVE` |  | Wait for the running job to finish, then start the new one. |
| `BUNDLE_TOO_LARGE` |  | Split the passes across smaller bundles. |
| `CONNECTION_ORG` |  | Use a connection id from your own organization's GET /api/v1/connections. |
| `CONNECTION_TRANSFER_PENDING` |  | Wait for the transfer to finish, then send the request again. |
| `CREATE_STALE` |  | Look the pass up by externalId with GET /api/v1/passes and update it instead of creating it again. |
| `CREDENTIAL_REF_KEYSET_CONFIG_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `CREDENTIAL_REF_KEYSET_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `DELIVERY_STALE` |  | Review the recipient and try again. |
| `DEVICE_TOKEN_UNAVAILABLE` |  | Retry the request; if it persists, send the requestId to support. |
| `EMAIL_INVALID` |  | Send a valid address in the email field. |
| `EXTERNAL_ID_TAKEN` |  | Send a new externalId, or PATCH the existing pass. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDEMPOTENCY_IN_PROGRESS` |  | Wait a moment and resend the identical request. |
| `IDEMPOTENCY_KEY_INVALID` |  | Send a unique string of 1 to 200 characters, such as a UUID. |
| `IDEMPOTENCY_KEY_REUSED` |  | Use a new key for a new request; resend the identical request to replay. |
| `IF_MATCH_INVALID` |  | Send the version from the last GET, for example If-Match: 3. |
| `IMPORT_BUSY` |  | Wait for it to finish with GET /api/v1/pass-imports/{id}, then retry. |
| `IMPORT_COLUMN_MISSING` |  | Add the column to the file, or change the mapping, then check again. |
| `IMPORT_EXPIRED` |  | Upload the file again with POST /api/v1/pass-imports. |
| `IMPORT_FILE_GONE` |  | Upload it again. |
| `IMPORT_HAS_ERRORS` |  | Fix the rows listed in GET /api/v1/pass-imports/{id}/errors.csv, or skip them, then commit again. |
| `IMPORT_HEADER_TOO_LONG` |  | Shorten the header and upload the file again. |
| `IMPORT_ID_TAKEN` |  | Check the import again with POST /api/v1/pass-imports/{id}/check, then commit. |
| `IMPORT_NOT_FOUND` |  | Check the id with GET /api/v1/pass-imports. |
| `IMPORT_PASS_CHANGED` |  | Remove the pass on its own with POST /api/v1/passes/{id}/remove. |
| `IMPORT_PLAN_INVALID` |  | Fix the mapping entries named in issues and check again. |
| `IMPORT_ROW_UNRESERVED` |  | Retry the commit; if it persists, send the requestId to support. |
| `IMPORT_STATE` |  | Check its state with GET /api/v1/pass-imports/{id} and call the action that state allows. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVALID_INPUT` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `JOIN_NOT_READY` |  | Publish the template, then enable the link with PUT /api/v1/join-links/{templateId}. |
| `MATCH_NEEDS_TEMPLATE` |  | Send orgId and templateId with the input filter. |
| `MEMBER_PHOTO_CHANGED` |  | Fetch the pass with GET /api/v1/passes/{id} and save the photo again. |
| `MEMBER_PHOTO_DIMENSIONS` |  | Crop the photo to a 270 by 270 pixel square and upload it again. |
| `MEMBER_PHOTO_ENCODING` |  | Send the photo as a PNG or JPEG file. |
| `MEMBER_PHOTO_NOT_FOUND` |  | Add one with PUT /api/v1/passes/{id}/member-photo. |
| `MEMBER_PHOTO_STYLE` |  | Use a template of that style, or remove the strip image. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `MODE_MISMATCH` |  | Use objects and a key of the same mode. |
| `NEW_CODE_UNSUPPORTED` |  | Reissue the pass with POST /api/v1/passes/bulk-reissue instead of requesting a new code. |
| `NOT_FOUND` |  | Check the id, and that the key's mode (test or live) matches the object. |
| `NO_RECIPIENT` |  | Set the holder's email with PATCH /api/v1/passes/{id}, then send again. |
| `ORG_ACCESS_CHANGED` |  | Check access with GET /api/v1/api-keys/me, then send the request again. |
| `ORG_FORBIDDEN` |  | Use a key scoped to this organization, or a platform key for platform-wide lists. |
| `ORG_MIXED` |  | Send ids from one organization per request. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_REQUIRED` |  | Send orgId with the request, or use a key scoped to one organization. |
| `PASS_CONFLICT` |  | Fetch the pass with GET /api/v1/passes/{id} and send the request again. |
| `PASS_CONNECTION_MISMATCH` |  | Link it with PUT /api/v1/passes/{id}/connection, then send the request again. |
| `PASS_FILE_MISSING` |  | Rebuild it with POST /api/v1/passes/{id}/refresh. |
| `PASS_INPUT_INVALID` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `PASS_INVALID` |  | Fix the problems named in issues in the template or inputs. |
| `PASS_NOT_ACTIVE` |  | Restore or unvoid the pass first, or use an active one. |
| `PASS_NOT_FOUND` |  | Check the id with GET /api/v1/passes and the key's mode. |
| `PASS_REF_TAKEN` |  | Use a different ref, or update the existing pass. |
| `PASS_REISSUE_REQUIRED` |  | Reissue it with POST /api/v1/passes/bulk-reissue. |
| `PASS_REMOVED` |  | Restore it with POST /api/v1/passes/{id}/restore, then send the request again. |
| `PASS_TRANSFER_NOT_FOUND` |  | Check the transfer id. |
| `PASS_TRANSFER_PENDING` |  | Try again shortly. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `RECIPIENT_NOT_HOLDER` |  | Send to the holder's email, or change it with PATCH /api/v1/passes/{id}. |
| `SCAN_EVENT_NOT_FOUND` |  | Check the event id with GET /api/v1/scan/events. |
| `SCAN_WINDOW_INVALID` |  | Set an end after the start, or fix the template's dates. |
| `SERIAL_TAKEN` |  | Send a different serial, or leave it out to have one generated. |
| `SESSION_REQUIRED` |  | Do it in the console, or sign in as the account that started it. |
| `STAMPS_ABOVE_MAX` |  | Raise the template's stamp maximum, or redeem stamps first. |
| `STAMPS_CARD_FULL` |  | Redeem the reward, then add stamps. |
| `STAMPS_NONE` |  | Use a template with stamps. |
| `STAMPS_NO_REWARD` |  | Add stamps until the card is full, then redeem. |
| `TEMPLATE_NOT_FOUND` |  | Check the id with GET /api/v1/templates and the key's mode. |
| `TEMPLATE_RELEASE_CONFLICT` |  | Send the request again to use the current release. |
| `TEMPLATE_RELEASE_REQUIRED` |  | Approve a release with POST /api/v1/templates/{id}/candidates/{candidateId}/approve. |
| `TERM_MANAGED` |  | Change the term in the connected system. |
| `TERM_NONE` |  | Renew only passes whose template defines a term. |
| `TERM_NOT_STARTED` |  | Renew after the term starts. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |
| `VERSION_NOT_FOUND` |  | Check the version with GET /api/v1/passes/{id}. |
| `VERSION_PURGED` |  | Request a newer version. |
| `WORKFLOW_START` |  | Send the request again. |

```sh
curl -X GET "https://passbook.mobile/api/v1/pass-imports/0193a1b2-7c00-7000-8000-0000000000e1/results.csv" \
  -H "Authorization: Bearer $PASSBOOK_KEY"
```

## Email the created passes that were not emailed, 50 a call; a repeat emails nobody twice {#sendEmails}

`POST /api/v1/pass-imports/{id}/email-rest`

Scopes: `passes:write`. SDK name: `pb.passImports.sendEmails`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string · max 64 | yes |  |
| `cursor` | body | string \| null · max 64 | yes |  |

Returns `200`.

| Code | Status | Fix |
| --- | --- | --- |
| `ASSET_DIMENSIONS` |  | Resize the image to the size named in issues and upload it again. |
| `ASSET_NOT_FOUND` |  | Check the image name or id and that it belongs to this organization. |
| `ASSET_NOT_PNG` |  | Re-export the image as a standard RGB or RGBA PNG and upload it again. |
| `ASSET_SIZE` |  | Compress the image below 1 MB and upload it again. |
| `ASSET_SLOT` |  | Use a slot name from the pass type's image slots in the request path. |
| `BULK_RUN_ACTIVE` |  | Wait for the running job to finish, then start the new one. |
| `BUNDLE_TOO_LARGE` |  | Split the passes across smaller bundles. |
| `CONNECTION_ORG` |  | Use a connection id from your own organization's GET /api/v1/connections. |
| `CONNECTION_TRANSFER_PENDING` |  | Wait for the transfer to finish, then send the request again. |
| `CREATE_STALE` |  | Look the pass up by externalId with GET /api/v1/passes and update it instead of creating it again. |
| `CREDENTIAL_REF_KEYSET_CONFIG_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `CREDENTIAL_REF_KEYSET_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `DELIVERY_STALE` |  | Review the recipient and try again. |
| `DEVICE_TOKEN_UNAVAILABLE` |  | Retry the request; if it persists, send the requestId to support. |
| `EMAIL_INVALID` |  | Send a valid address in the email field. |
| `EXTERNAL_ID_TAKEN` |  | Send a new externalId, or PATCH the existing pass. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDEMPOTENCY_IN_PROGRESS` |  | Wait a moment and resend the identical request. |
| `IDEMPOTENCY_KEY_INVALID` |  | Send a unique string of 1 to 200 characters, such as a UUID. |
| `IDEMPOTENCY_KEY_REUSED` |  | Use a new key for a new request; resend the identical request to replay. |
| `IF_MATCH_INVALID` |  | Send the version from the last GET, for example If-Match: 3. |
| `IMPORT_BUSY` |  | Wait for it to finish with GET /api/v1/pass-imports/{id}, then retry. |
| `IMPORT_COLUMN_MISSING` |  | Add the column to the file, or change the mapping, then check again. |
| `IMPORT_EXPIRED` |  | Upload the file again with POST /api/v1/pass-imports. |
| `IMPORT_FILE_GONE` |  | Upload it again. |
| `IMPORT_HAS_ERRORS` |  | Fix the rows listed in GET /api/v1/pass-imports/{id}/errors.csv, or skip them, then commit again. |
| `IMPORT_HEADER_TOO_LONG` |  | Shorten the header and upload the file again. |
| `IMPORT_ID_TAKEN` |  | Check the import again with POST /api/v1/pass-imports/{id}/check, then commit. |
| `IMPORT_NOT_FOUND` |  | Check the id with GET /api/v1/pass-imports. |
| `IMPORT_PASS_CHANGED` |  | Remove the pass on its own with POST /api/v1/passes/{id}/remove. |
| `IMPORT_PLAN_INVALID` |  | Fix the mapping entries named in issues and check again. |
| `IMPORT_ROW_UNRESERVED` |  | Retry the commit; if it persists, send the requestId to support. |
| `IMPORT_STATE` |  | Check its state with GET /api/v1/pass-imports/{id} and call the action that state allows. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVALID_INPUT` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `JOIN_NOT_READY` |  | Publish the template, then enable the link with PUT /api/v1/join-links/{templateId}. |
| `MATCH_NEEDS_TEMPLATE` |  | Send orgId and templateId with the input filter. |
| `MEMBER_PHOTO_CHANGED` |  | Fetch the pass with GET /api/v1/passes/{id} and save the photo again. |
| `MEMBER_PHOTO_DIMENSIONS` |  | Crop the photo to a 270 by 270 pixel square and upload it again. |
| `MEMBER_PHOTO_ENCODING` |  | Send the photo as a PNG or JPEG file. |
| `MEMBER_PHOTO_NOT_FOUND` |  | Add one with PUT /api/v1/passes/{id}/member-photo. |
| `MEMBER_PHOTO_STYLE` |  | Use a template of that style, or remove the strip image. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `MODE_MISMATCH` |  | Use objects and a key of the same mode. |
| `NEW_CODE_UNSUPPORTED` |  | Reissue the pass with POST /api/v1/passes/bulk-reissue instead of requesting a new code. |
| `NOT_FOUND` |  | Check the id, and that the key's mode (test or live) matches the object. |
| `NO_RECIPIENT` |  | Set the holder's email with PATCH /api/v1/passes/{id}, then send again. |
| `ORG_ACCESS_CHANGED` |  | Check access with GET /api/v1/api-keys/me, then send the request again. |
| `ORG_FORBIDDEN` |  | Use a key scoped to this organization, or a platform key for platform-wide lists. |
| `ORG_MIXED` |  | Send ids from one organization per request. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_REQUIRED` |  | Send orgId with the request, or use a key scoped to one organization. |
| `PASS_CONFLICT` |  | Fetch the pass with GET /api/v1/passes/{id} and send the request again. |
| `PASS_CONNECTION_MISMATCH` |  | Link it with PUT /api/v1/passes/{id}/connection, then send the request again. |
| `PASS_FILE_MISSING` |  | Rebuild it with POST /api/v1/passes/{id}/refresh. |
| `PASS_INPUT_INVALID` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `PASS_INVALID` |  | Fix the problems named in issues in the template or inputs. |
| `PASS_NOT_ACTIVE` |  | Restore or unvoid the pass first, or use an active one. |
| `PASS_NOT_FOUND` |  | Check the id with GET /api/v1/passes and the key's mode. |
| `PASS_REF_TAKEN` |  | Use a different ref, or update the existing pass. |
| `PASS_REISSUE_REQUIRED` |  | Reissue it with POST /api/v1/passes/bulk-reissue. |
| `PASS_REMOVED` |  | Restore it with POST /api/v1/passes/{id}/restore, then send the request again. |
| `PASS_TRANSFER_NOT_FOUND` |  | Check the transfer id. |
| `PASS_TRANSFER_PENDING` |  | Try again shortly. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `RECIPIENT_NOT_HOLDER` |  | Send to the holder's email, or change it with PATCH /api/v1/passes/{id}. |
| `SCAN_EVENT_NOT_FOUND` |  | Check the event id with GET /api/v1/scan/events. |
| `SCAN_WINDOW_INVALID` |  | Set an end after the start, or fix the template's dates. |
| `SERIAL_TAKEN` |  | Send a different serial, or leave it out to have one generated. |
| `SESSION_REQUIRED` |  | Do it in the console, or sign in as the account that started it. |
| `STAMPS_ABOVE_MAX` |  | Raise the template's stamp maximum, or redeem stamps first. |
| `STAMPS_CARD_FULL` |  | Redeem the reward, then add stamps. |
| `STAMPS_NONE` |  | Use a template with stamps. |
| `STAMPS_NO_REWARD` |  | Add stamps until the card is full, then redeem. |
| `TEMPLATE_NOT_FOUND` |  | Check the id with GET /api/v1/templates and the key's mode. |
| `TEMPLATE_RELEASE_CONFLICT` |  | Send the request again to use the current release. |
| `TEMPLATE_RELEASE_REQUIRED` |  | Approve a release with POST /api/v1/templates/{id}/candidates/{candidateId}/approve. |
| `TERM_MANAGED` |  | Change the term in the connected system. |
| `TERM_NONE` |  | Renew only passes whose template defines a term. |
| `TERM_NOT_STARTED` |  | Renew after the term starts. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |
| `VERSION_NOT_FOUND` |  | Check the version with GET /api/v1/passes/{id}. |
| `VERSION_PURGED` |  | Request a newer version. |
| `WORKFLOW_START` |  | Send the request again. |

```sh
curl -X POST "https://passbook.mobile/api/v1/pass-imports/0193a1b2-7c00-7000-8000-0000000000e1/email-rest" \
  -H "Authorization: Bearer $PASSBOOK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "cursor": "Example"
}'
```

## Rows of an import, 100 a page {#rows-list}

`GET /api/v1/pass-imports/{id}/rows`

Scopes: `passes:read`. SDK name: `pb.passImports.rows.list`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string · max 64 | yes |  |
| `state` | query | "planned" \| "done" \| "failed" \| "skipped" |  |  |
| `cursor` | query | string · max 512 |  |  |

Returns `200`.

| Code | Status | Fix |
| --- | --- | --- |
| `ASSET_DIMENSIONS` |  | Resize the image to the size named in issues and upload it again. |
| `ASSET_NOT_FOUND` |  | Check the image name or id and that it belongs to this organization. |
| `ASSET_NOT_PNG` |  | Re-export the image as a standard RGB or RGBA PNG and upload it again. |
| `ASSET_SIZE` |  | Compress the image below 1 MB and upload it again. |
| `ASSET_SLOT` |  | Use a slot name from the pass type's image slots in the request path. |
| `BULK_RUN_ACTIVE` |  | Wait for the running job to finish, then start the new one. |
| `BUNDLE_TOO_LARGE` |  | Split the passes across smaller bundles. |
| `CONNECTION_ORG` |  | Use a connection id from your own organization's GET /api/v1/connections. |
| `CONNECTION_TRANSFER_PENDING` |  | Wait for the transfer to finish, then send the request again. |
| `CREATE_STALE` |  | Look the pass up by externalId with GET /api/v1/passes and update it instead of creating it again. |
| `CREDENTIAL_REF_KEYSET_CONFIG_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `CREDENTIAL_REF_KEYSET_UNAVAILABLE` |  | Retry with backoff; if it persists, send the requestId to support. |
| `DELIVERY_STALE` |  | Review the recipient and try again. |
| `DEVICE_TOKEN_UNAVAILABLE` |  | Retry the request; if it persists, send the requestId to support. |
| `EMAIL_INVALID` |  | Send a valid address in the email field. |
| `EXTERNAL_ID_TAKEN` |  | Send a new externalId, or PATCH the existing pass. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDEMPOTENCY_IN_PROGRESS` |  | Wait a moment and resend the identical request. |
| `IDEMPOTENCY_KEY_INVALID` |  | Send a unique string of 1 to 200 characters, such as a UUID. |
| `IDEMPOTENCY_KEY_REUSED` |  | Use a new key for a new request; resend the identical request to replay. |
| `IF_MATCH_INVALID` |  | Send the version from the last GET, for example If-Match: 3. |
| `IMPORT_BUSY` |  | Wait for it to finish with GET /api/v1/pass-imports/{id}, then retry. |
| `IMPORT_COLUMN_MISSING` |  | Add the column to the file, or change the mapping, then check again. |
| `IMPORT_EXPIRED` |  | Upload the file again with POST /api/v1/pass-imports. |
| `IMPORT_FILE_GONE` |  | Upload it again. |
| `IMPORT_HAS_ERRORS` |  | Fix the rows listed in GET /api/v1/pass-imports/{id}/errors.csv, or skip them, then commit again. |
| `IMPORT_HEADER_TOO_LONG` |  | Shorten the header and upload the file again. |
| `IMPORT_ID_TAKEN` |  | Check the import again with POST /api/v1/pass-imports/{id}/check, then commit. |
| `IMPORT_NOT_FOUND` |  | Check the id with GET /api/v1/pass-imports. |
| `IMPORT_PASS_CHANGED` |  | Remove the pass on its own with POST /api/v1/passes/{id}/remove. |
| `IMPORT_PLAN_INVALID` |  | Fix the mapping entries named in issues and check again. |
| `IMPORT_ROW_UNRESERVED` |  | Retry the commit; if it persists, send the requestId to support. |
| `IMPORT_STATE` |  | Check its state with GET /api/v1/pass-imports/{id} and call the action that state allows. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVALID_INPUT` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `JOIN_NOT_READY` |  | Publish the template, then enable the link with PUT /api/v1/join-links/{templateId}. |
| `MATCH_NEEDS_TEMPLATE` |  | Send orgId and templateId with the input filter. |
| `MEMBER_PHOTO_CHANGED` |  | Fetch the pass with GET /api/v1/passes/{id} and save the photo again. |
| `MEMBER_PHOTO_DIMENSIONS` |  | Crop the photo to a 270 by 270 pixel square and upload it again. |
| `MEMBER_PHOTO_ENCODING` |  | Send the photo as a PNG or JPEG file. |
| `MEMBER_PHOTO_NOT_FOUND` |  | Add one with PUT /api/v1/passes/{id}/member-photo. |
| `MEMBER_PHOTO_STYLE` |  | Use a template of that style, or remove the strip image. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `MODE_MISMATCH` |  | Use objects and a key of the same mode. |
| `NEW_CODE_UNSUPPORTED` |  | Reissue the pass with POST /api/v1/passes/bulk-reissue instead of requesting a new code. |
| `NOT_FOUND` |  | Check the id, and that the key's mode (test or live) matches the object. |
| `NO_RECIPIENT` |  | Set the holder's email with PATCH /api/v1/passes/{id}, then send again. |
| `ORG_ACCESS_CHANGED` |  | Check access with GET /api/v1/api-keys/me, then send the request again. |
| `ORG_FORBIDDEN` |  | Use a key scoped to this organization, or a platform key for platform-wide lists. |
| `ORG_MIXED` |  | Send ids from one organization per request. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_REQUIRED` |  | Send orgId with the request, or use a key scoped to one organization. |
| `PASS_CONFLICT` |  | Fetch the pass with GET /api/v1/passes/{id} and send the request again. |
| `PASS_CONNECTION_MISMATCH` |  | Link it with PUT /api/v1/passes/{id}/connection, then send the request again. |
| `PASS_FILE_MISSING` |  | Rebuild it with POST /api/v1/passes/{id}/refresh. |
| `PASS_INPUT_INVALID` |  | Fix the inputs named in issues; GET /api/v1/templates/{id}/input-schema lists them. |
| `PASS_INVALID` |  | Fix the problems named in issues in the template or inputs. |
| `PASS_NOT_ACTIVE` |  | Restore or unvoid the pass first, or use an active one. |
| `PASS_NOT_FOUND` |  | Check the id with GET /api/v1/passes and the key's mode. |
| `PASS_REF_TAKEN` |  | Use a different ref, or update the existing pass. |
| `PASS_REISSUE_REQUIRED` |  | Reissue it with POST /api/v1/passes/bulk-reissue. |
| `PASS_REMOVED` |  | Restore it with POST /api/v1/passes/{id}/restore, then send the request again. |
| `PASS_TRANSFER_NOT_FOUND` |  | Check the transfer id. |
| `PASS_TRANSFER_PENDING` |  | Try again shortly. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `RECIPIENT_NOT_HOLDER` |  | Send to the holder's email, or change it with PATCH /api/v1/passes/{id}. |
| `SCAN_EVENT_NOT_FOUND` |  | Check the event id with GET /api/v1/scan/events. |
| `SCAN_WINDOW_INVALID` |  | Set an end after the start, or fix the template's dates. |
| `SERIAL_TAKEN` |  | Send a different serial, or leave it out to have one generated. |
| `SESSION_REQUIRED` |  | Do it in the console, or sign in as the account that started it. |
| `STAMPS_ABOVE_MAX` |  | Raise the template's stamp maximum, or redeem stamps first. |
| `STAMPS_CARD_FULL` |  | Redeem the reward, then add stamps. |
| `STAMPS_NONE` |  | Use a template with stamps. |
| `STAMPS_NO_REWARD` |  | Add stamps until the card is full, then redeem. |
| `TEMPLATE_NOT_FOUND` |  | Check the id with GET /api/v1/templates and the key's mode. |
| `TEMPLATE_RELEASE_CONFLICT` |  | Send the request again to use the current release. |
| `TEMPLATE_RELEASE_REQUIRED` |  | Approve a release with POST /api/v1/templates/{id}/candidates/{candidateId}/approve. |
| `TERM_MANAGED` |  | Change the term in the connected system. |
| `TERM_NONE` |  | Renew only passes whose template defines a term. |
| `TERM_NOT_STARTED` |  | Renew after the term starts. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |
| `VERSION_NOT_FOUND` |  | Check the version with GET /api/v1/passes/{id}. |
| `VERSION_PURGED` |  | Request a newer version. |
| `WORKFLOW_START` |  | Send the request again. |

```sh
curl -X GET "https://passbook.mobile/api/v1/pass-imports/0193a1b2-7c00-7000-8000-0000000000e1/rows" \
  -H "Authorization: Bearer $PASSBOOK_KEY"
```

## Console only

Signed-in console sessions only; an API key cannot call these.

- `POST /api/v1/pass-imports/{id}/remove-created`: Remove the passes this import created, 50 a call; edited or scanned ones are skipped
