# Images

Upload images.


## Upload image {#uploadimageprivate}

Uploads a PNG and stores it as a [private image](/docs/guides/wallet/user-guide/design-template/private-images/) for use in a pass. Private images are primarily used for Google Wallet passes, where the `mainImage` must be hosted by Airship.

This endpoint also supports the Apple Wallet image types `thumbnail_image` and `strip_image`, but private images aren't required for those fields.

[Jump to examples ↓](#uploadimageprivate-examples)

### `POST /images/projects/{projectId}/{imageNameIdentifier}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wimg

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `string` | Required | The ID of the project. |
| `imageNameIdentifier` | `string` | Required | The unique identifier for the image. Usually consists of an alphanumeric name and a `.png` extension. Can be used as part of the image URL. |

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `imageType` | `string` | Required | The image type. This determines the dimensions the image is resized to on upload.  * `mainImage` — The main image in the `imageModulesData` field for Google Wallet passes. The uploaded image is resized to 180×180 pixels. Google only supports private images on `imageModulesData`. If used on any other Google Wallet pass field, the image is dropped. * `thumbnail_image` — The thumbnail image for an Apple Wallet pass. The uploaded image is resized to 180×180 pixels. * `strip_image` — The strip image for an Apple Wallet pass. The uploaded image is resized to 624×246 pixels.  For Apple Wallet, you can use the uploaded image in any pass field, but it may not be the correct size if used outside the type specified here.  Possible values: `mainImage`, `thumbnail_image`, `strip_image` |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The API revision. Possible values: `1.2` |

**Request body**

The raw binary data of the image to upload. Only PNG is supported.

**Content-Type:** `image/png`

Type: `string`

**Responses**

**`200`** Successful upload. Returns metadata about the uploaded image.

Use the `path` value returned in this response as the image field's value in a pass creation or update payload. See [Use a private image in a pass](/docs/guides/wallet/user-guide/design-template/private-images/#use-a-private-image-in-a-pass) in *Add private images to wallet passes*.

Response body:

**Content-Type:** `application/json`

[Image Metadata]({{< ref "/developer/rest-api/wallet/schemas/others/" >}}#imagemetadata)

**`400`** Missing or malformed input, invalid image format, or invalid image type.

**Examples**

*Example request*

```http
POST /v1/images/projects/12345/test_image.png?imageType=thumbnail_image HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: image/png
Api-Revision: 1.2

[Binary PNG data]

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "path": "passtools_prod/1/images/587ac4e3d188b0fcd4f05038d8814fefd82ac834_test_image.png",
  "source": "uploaded",
  "imageType": "thumbnail_image",
  "width": 180,
  "height": 180
}

```

---

