# Brand

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

## Get the brand kit {#retrieve}

`GET /api/v1/brand`

Scopes: `brand:manage`. SDK name: `pb.brand.retrieve`.

Returns `200`.

| Code | Status | Fix |
| --- | --- | --- |
| `BRAND_IMAGE_NOT_FOUND` |  | Upload the image with PUT /api/v1/orgs/{id}/branding/{slot} and use the URL it returns. |
| `BRAND_MARK_NOT_ALLOWED` |  | Remove the setting, or ask the platform owner to enable it for the organization. |
| `ENTITLEMENTS_CHANGED` |  | Fetch them with GET /api/v1/orgs/{id}/entitlements and send your change again. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDENTITY_NOT_FOUND` |  | Check the id with GET /api/v1/identities. |
| `IMAGE_BYTES` |  | Compress the image and upload it again. |
| `IMAGE_INVALID` |  | Export a standard PNG and upload it again. |
| `IMAGE_NOT_FOUND` |  | Upload one with PUT /api/v1/orgs/{id}/branding/{slot}. |
| `IMAGE_SCALE` |  | Resize so the @2x image is two thirds of the @3x, then upload both. |
| `IMAGE_SIZE` |  | Resize to the size named in issues and upload it again. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVITATION_INVALID` |  | Ask an organization admin to send a new invitation with POST /api/v1/orgs/{id}/invitations. |
| `INVITATION_PENDING` |  | Revoke it to send a new one. |
| `LAST_ORG_ADMIN` |  | Make someone else an org admin first. |
| `MEMBERSHIP_CONFLICT` |  | Fetch it with GET /api/v1/orgs/{id}/memberships and send the change again. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `ORG_CONFLICT` |  | Fetch it with GET /api/v1/orgs/{id} and send the change again. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_PERSONAL_SINGLE_MEMBER` |  | Use a regular organization to work with others. |
| `ORG_SLUG_RESERVED` |  | Choose a different slug. |
| `ORG_SLUG_TAKEN` |  | Choose a different slug. |
| `ORG_STATUS_ALONE` |  | Send the status change in its own request, then the other edits. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `SETTINGS_CHANGED` |  | Fetch them with GET /api/v1/settings and send your change again. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |

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

## Set the accent colour and mark level {#update}

`PATCH /api/v1/brand`

Scopes: `brand:manage`. SDK name: `pb.brand.update`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accent` | body | string \| null · ^#[0-9a-fA-F]{6}$ |  |  |
| `mark` | body | "full" \| "small" \| "none" |  |  |
| `configRevision` | body | integer |  |  |

Returns `200`, a `Org`.

| Code | Status | Fix |
| --- | --- | --- |
| `BRAND_IMAGE_NOT_FOUND` |  | Upload the image with PUT /api/v1/orgs/{id}/branding/{slot} and use the URL it returns. |
| `BRAND_MARK_NOT_ALLOWED` |  | Remove the setting, or ask the platform owner to enable it for the organization. |
| `ENTITLEMENTS_CHANGED` |  | Fetch them with GET /api/v1/orgs/{id}/entitlements and send your change again. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDENTITY_NOT_FOUND` |  | Check the id with GET /api/v1/identities. |
| `IMAGE_BYTES` |  | Compress the image and upload it again. |
| `IMAGE_INVALID` |  | Export a standard PNG and upload it again. |
| `IMAGE_NOT_FOUND` |  | Upload one with PUT /api/v1/orgs/{id}/branding/{slot}. |
| `IMAGE_SCALE` |  | Resize so the @2x image is two thirds of the @3x, then upload both. |
| `IMAGE_SIZE` |  | Resize to the size named in issues and upload it again. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVITATION_INVALID` |  | Ask an organization admin to send a new invitation with POST /api/v1/orgs/{id}/invitations. |
| `INVITATION_PENDING` |  | Revoke it to send a new one. |
| `LAST_ORG_ADMIN` |  | Make someone else an org admin first. |
| `MEMBERSHIP_CONFLICT` |  | Fetch it with GET /api/v1/orgs/{id}/memberships and send the change again. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `ORG_CONFLICT` |  | Fetch it with GET /api/v1/orgs/{id} and send the change again. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_PERSONAL_SINGLE_MEMBER` |  | Use a regular organization to work with others. |
| `ORG_SLUG_RESERVED` |  | Choose a different slug. |
| `ORG_SLUG_TAKEN` |  | Choose a different slug. |
| `ORG_STATUS_ALONE` |  | Send the status change in its own request, then the other edits. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `SETTINGS_CHANGED` |  | Fetch them with GET /api/v1/settings and send your change again. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |

```sh
curl -X PATCH "https://passbook.mobile/api/v1/brand" \
  -H "Authorization: Bearer $PASSBOOK_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Upload the web logo {#webLogo-upload}

`PUT /api/v1/brand/web-logo`

Scopes: `brand:manage`. SDK name: `pb.brand.webLogo.upload`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `png` | body | string · max 699059 | yes |  |
| `configRevision` | body | integer |  |  |

Returns `200`, a `Org`.

| Code | Status | Fix |
| --- | --- | --- |
| `BRAND_IMAGE_NOT_FOUND` |  | Upload the image with PUT /api/v1/orgs/{id}/branding/{slot} and use the URL it returns. |
| `BRAND_MARK_NOT_ALLOWED` |  | Remove the setting, or ask the platform owner to enable it for the organization. |
| `ENTITLEMENTS_CHANGED` |  | Fetch them with GET /api/v1/orgs/{id}/entitlements and send your change again. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDENTITY_NOT_FOUND` |  | Check the id with GET /api/v1/identities. |
| `IMAGE_BYTES` |  | Compress the image and upload it again. |
| `IMAGE_INVALID` |  | Export a standard PNG and upload it again. |
| `IMAGE_NOT_FOUND` |  | Upload one with PUT /api/v1/orgs/{id}/branding/{slot}. |
| `IMAGE_SCALE` |  | Resize so the @2x image is two thirds of the @3x, then upload both. |
| `IMAGE_SIZE` |  | Resize to the size named in issues and upload it again. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVITATION_INVALID` |  | Ask an organization admin to send a new invitation with POST /api/v1/orgs/{id}/invitations. |
| `INVITATION_PENDING` |  | Revoke it to send a new one. |
| `LAST_ORG_ADMIN` |  | Make someone else an org admin first. |
| `MEMBERSHIP_CONFLICT` |  | Fetch it with GET /api/v1/orgs/{id}/memberships and send the change again. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `ORG_CONFLICT` |  | Fetch it with GET /api/v1/orgs/{id} and send the change again. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_PERSONAL_SINGLE_MEMBER` |  | Use a regular organization to work with others. |
| `ORG_SLUG_RESERVED` |  | Choose a different slug. |
| `ORG_SLUG_TAKEN` |  | Choose a different slug. |
| `ORG_STATUS_ALONE` |  | Send the status change in its own request, then the other edits. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `SETTINGS_CHANGED` |  | Fetch them with GET /api/v1/settings and send your change again. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |

```sh
curl -X PUT "https://passbook.mobile/api/v1/brand/web-logo" \
  -H "Authorization: Bearer $PASSBOOK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "png": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGUlEQVR42mOQz3/9nxLMMGrAqAGjBgwXAwCBLngfV/beKAAAAABJRU5ErkJggg=="
}'
```

## Remove the web logo {#webLogo-delete}

`DELETE /api/v1/brand/web-logo`

Scopes: `brand:manage`. SDK name: `pb.brand.webLogo.delete`.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `configRevision` | query | integer \| null |  |  |

Returns `200`, a `Org`.

| Code | Status | Fix |
| --- | --- | --- |
| `BRAND_IMAGE_NOT_FOUND` |  | Upload the image with PUT /api/v1/orgs/{id}/branding/{slot} and use the URL it returns. |
| `BRAND_MARK_NOT_ALLOWED` |  | Remove the setting, or ask the platform owner to enable it for the organization. |
| `ENTITLEMENTS_CHANGED` |  | Fetch them with GET /api/v1/orgs/{id}/entitlements and send your change again. |
| `FORBIDDEN` |  | Use a key with the scope the operation lists, or ask an org admin. |
| `IDENTITY_NOT_FOUND` |  | Check the id with GET /api/v1/identities. |
| `IMAGE_BYTES` |  | Compress the image and upload it again. |
| `IMAGE_INVALID` |  | Export a standard PNG and upload it again. |
| `IMAGE_NOT_FOUND` |  | Upload one with PUT /api/v1/orgs/{id}/branding/{slot}. |
| `IMAGE_SCALE` |  | Resize so the @2x image is two thirds of the @3x, then upload both. |
| `IMAGE_SIZE` |  | Resize to the size named in issues and upload it again. |
| `INVALID_API_KEY` |  | Create a new key in the console and update PASSBOOK_KEY. |
| `INVITATION_INVALID` |  | Ask an organization admin to send a new invitation with POST /api/v1/orgs/{id}/invitations. |
| `INVITATION_PENDING` |  | Revoke it to send a new one. |
| `LAST_ORG_ADMIN` |  | Make someone else an org admin first. |
| `MEMBERSHIP_CONFLICT` |  | Fetch it with GET /api/v1/orgs/{id}/memberships and send the change again. |
| `MISSING_SCOPE` |  | Create a key with the scope the operation lists under security. |
| `ORG_CONFLICT` |  | Fetch it with GET /api/v1/orgs/{id} and send the change again. |
| `ORG_NOT_FOUND` |  | Check orgId with GET /api/v1/orgs. |
| `ORG_PERSONAL_SINGLE_MEMBER` |  | Use a regular organization to work with others. |
| `ORG_SLUG_RESERVED` |  | Choose a different slug. |
| `ORG_SLUG_TAKEN` |  | Choose a different slug. |
| `ORG_STATUS_ALONE` |  | Send the status change in its own request, then the other edits. |
| `RATE_LIMITED` |  | Wait for Retry-After seconds, then retry. Back off on repeats. |
| `SETTINGS_CHANGED` |  | Fetch them with GET /api/v1/settings and send your change again. |
| `UNAUTHENTICATED` |  | Send Authorization: Bearer $PASSBOOK_KEY. |
| `VALIDATION` |  | Fix each field in issues and resend. |

```sh
curl -X DELETE "https://passbook.mobile/api/v1/brand/web-logo" \
  -H "Authorization: Bearer $PASSBOOK_KEY"
```

## Console only

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

- `PUT /api/v1/orgs/{id}/branding/{slot}`: Upload the pass logo or icon (@3x PNG; @2x derived)
- `DELETE /api/v1/orgs/{id}/branding/{slot}`: Remove the pass logo or icon
- `GET /api/v1/orgs/{id}/branding/{slot}/{scale}`: Download the pass logo or icon
- `GET /api/v1/orgs/{id}/email-preview`: The pass email as holders get it, with sample holder data (HTML)
