> For the complete documentation index, see [llms.txt](https://docs.merchone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.merchone.com/api-reference/api-v1/library.md).

# Library

## Introduction

Through the endpoints included in the **Library** section, you will be able to:

* Retrieve all the available images from the library
* Retrieve an image from the library
* Add an image to the library

## Endpoints

## Show library

> This API endpoint retrieves a list of all images from your library

```json
{"openapi":"3.0.3","info":{"title":"MerchOne API","version":"1.0.0"},"servers":[{"url":"https://api.merchone.com/api/v1"}],"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"paths":{"/library":{"get":{"tags":["Library"],"summary":"Show library","description":"This API endpoint retrieves a list of all images from your library","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"image_id":{"type":"string"},"file_name":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"size":{"type":"string"},"image_url":{"type":"string"}}}}}}}}},"401":{"description":"Unauthorized"}}}}}}
```

## Show an image from the library

> This API endpoint retrieves an images from your library

```json
{"openapi":"3.0.3","info":{"title":"MerchOne API","version":"1.0.0"},"servers":[{"url":"https://api.merchone.com/api/v1"}],"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"paths":{"/library/{image}":{"get":{"tags":["Library"],"summary":"Show an image from the library","description":"This API endpoint retrieves an images from your library","parameters":[{"name":"image","description":"The ID of the image.","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"image_id":{"type":"string"},"file_name":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"size":{"type":"string"},"image_url":{"type":"string"}}}}}}}},"401":{"description":"Unauthorized"},"404":{"description":"Not found."}}}}}}
```

## Post a new image to the library

> This API endpoint allows you to upload a new image to your library

```json
{"openapi":"3.0.3","info":{"title":"MerchOne API","version":"1.0.0"},"servers":[{"url":"https://api.merchone.com/api/v1"}],"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"paths":{"/library":{"post":{"tags":["Library"],"summary":"Post a new image to the library","description":"This API endpoint allows you to upload a new image to your library","parameters":[{"name":"Accept","in":"header","description":"Media type(s) that is/are acceptable for the response","required":true,"schema":{"type":"string","default":"application/json","enum":["application/json"]}}],"requestBody":{"description":"Request body","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"file_name":{"type":"string"},"url":{"type":"string"}},"required":["file_name","url"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"image_id":{"type":"string"},"file_name":{"type":"string"},"upload_date":{"type":"string"}}}}}}}},"401":{"description":"Unauthorized"}}}}}}
```
