Upload and store images with Moov to create an image library. Link images to products in your product catalog.

Use the [images API](https://docs.moov.io/api/tools/images/) to upload an image up to 16MB in PNG, JPG, or WebP format. Every image will be given a unique `imageID`, which can be linked to products in your product catalog, enhancing your transfer UI. Each Moov account has a starting limit of 300 images.

View the [product catalog](https://docs.moov.io/guides/accounts/product-catalog/) guide for more information on how to use images with products.

## Upload image

In addition to the image itself, you can supply alt-text through the `metadata` field. Duplicate images and images larger than 16MB will be rejected.

Ask

```zsh
curl -X POST "https://api.moov.io/accounts/{accountID}/images" \
  -H "Authorization: Bearer {token}" \
  --data '{
    "image": "00010101011111000101010110",
    "metadata": {
      "altText": "Blue oat milk carton by Fancy Brand"
    }
  }'\
```

The response will include an `imageID` which can be used to get metadata, replace, or delete an image.

The `link` is the public URL to access the image. You can add a `size={width}x{height}` parameter to the public URL to resize the image. Additionally, the `publicID` is a unique identifier which is used in the URL and can also be used in public endpoints.

Ask

```json
{
  "imageID": "bbdcb050-2e05-43cb-812a-e1296cd0c01a",
  "publicID": "string",
  "altText": "string",
  "link": "https://api.moov.io/images/qJRAaAwwF5hmfeAFdHjIb",
  "createdOn": "2019-08-24T14:15:22Z",
  "updatedOn": "2019-08-24T14:15:22Z"
}
```

## Manage images

Once an image has been uploaded, you can retrieve a list of all image metadata, or get a singular image's metadata. You can also update an image's metadata, or replace an existing image, including its metadata.

Deleting an image permanently removes it from Moov.

### Retrieve metadata

Retrieve a list of all image metadata, or get metadata for a specific image.

Ask

```zsh
curl -X GET "https://api.moov.io/accounts/{accountID}/images/" \
  -H "Authorization: Bearer {token}" \
```

Ask

```zsh
curl -X GET "https://api.moov.io/accounts/{accountID}/images/{imageID}" \
  -H "Authorization: Bearer {token}" \
```

### Update an image

You can replace an image and, optionally, its metadata, or you can just update its metadata.

Ask

```zsh
curl -X PUT "https://api.moov.io/accounts/{accountID}/images/{imageID}" \
  -H "Authorization: Bearer {token}" \
  --data '{
    "image": "00010101011111001111000101010",
    "metadata": {
      "altText": "Red soy milk carton by Fancy Brand"
    }
  }'\
```

Ask

```zsh
curl -X PUT "https://api.moov.io/accounts/{accountID}/images/{imageID}/metadata" \
  -H "Authorization: Bearer {token}" \
  --data '{
    "metadata": {
      "altText": "New! Updated recipe, blue oat milk by Fancy Brand"
    }
  }'\
```

### Delete an image

Deleting an image permanently removes it from your collection stored with Moov.

Ask

```zsh
curl -X DELETE "https://api.moov.io/accounts/{accountID}/images/{imageID}" \
  -H "Authorization: Bearer {token}" \
```
