> For the complete documentation index, see [llms.txt](https://docs.prestashop-project.org/1-5-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prestashop-project.org/1-5-documentation/english-documentation/developer-guide/developer-tutorials/using-the-prestashop-web-service/chapter-9-image-management.md).

# Chapter 9 - Image management

Accessing the images is done through the `images` entity.

Several types of images are available.

* General shop images
* Product images
* Category images
* Manufacturer images
* Supplier images
* Store images

They can be reach using the following links:

* /api/images/general
* /api/images/products
* /api/images/categories
* /api/images/manufacturers
* /api/images/suppliers
* /api/images/stores

Various image size are available, depending on the image types. They are available as XLink links in the links above, encapsulated in the `image_types` node.

For instance, in order to retrieve the image with the id 10 for the product with id 5, we would use the following path: `/api/images/products/5/10`.

## Changing the images <a href="#chapter9-imagemanagement-changingtheimages" id="chapter9-imagemanagement-changingtheimages"></a>

In order to change the available images, we have to use a `POST` request, with the new image as its parameter.

For instance, here is how to change the image for category 2:

* HTTP method: PUT
* URL: /images/categories/2
* Parameters: images=\[binary content for the new image]

...and here is how to add a new image to the product with id '1':

* HTTP method: POST
* URL: /images/products/1
* Parameters: images=\[binary content for the new image]

Here is an HTML form enabling images to be sent:

```
<form enctype="multipart/form-data" method="POST" action="http://eWURcnNJ6mbLUHB10EEIzTZsTShs33IX@myprestahop.com/api/images/products/1">
  <fieldset>
    <legend>Add image for products No 1</legend>
    <input type="file" name="image">
    <input type="submit" value="Execute">
  </fieldset>
</form>
```

If you would rather use cURL:

```
$url = 'http://myprestashop.com/api/images/products/1';
$image_path = 'C:\\my_image.png';
$key = 'My web service key';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
//curl_setopt($ch, CURLOPT_PUT, true); // Un-commet to edit an image
curl_setopt($ch, CURLOPT_USERPWD, $key.':');
curl_setopt($ch, CURLOPT_POSTFIELDS, array('image' => '@'.$image_path));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.prestashop-project.org/1-5-documentation/english-documentation/developer-guide/developer-tutorials/using-the-prestashop-web-service/chapter-9-image-management.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
