> For the complete documentation index, see [llms.txt](https://docs.cloudimage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudimage.io/caching-and-acceleration/warmup-api.md).

# Warmup API

The Warmup API allows you to proactively cache your images in the Cloudimage infrastructure for faster processing before receiving the first request from your end users. We recommend to warm-up Cloudimage in the following cases:

* upon launching a new collection of thousands/millions of images - to make sure that at launch time, all images will be pre-processed and rocket fast for end users;
* at upload - to make sure that the uploaded image is already pre-processed to be immediately accessible for end users;
* when dealing with large images (large animated GIF files, gigapixels pictures, etc.) - as pre-processing is important to save time on first load;
* performance is a top priority even if it’s on the first load.

## Creating a warm-up task <a href="#od_4b6c13e1" id="od_4b6c13e1"></a>

You can provide a list of your images either in a txt/csv file or in the request's body.

POSThttps\://warmup.api.cloudimage.com/warmup/urls

### URL list from a file <a href="#od_ae33bced" id="od_ae33bced"></a>

#### **List file format**

You need to provide a text file with all your images for the warm-up (one URL per line):

```none
/sample.li/logo-cloudimg-black.png?w=200
/sample.li/logo-cloudimg-white.png?w=200
/sample.li/logo-cloudimg-yellow.png?w=200
/sample.li/hotel.jpg?pixellate=5
/sample.li/house.jpg?pixellate=5
/sample.li/eye.jpg?w=500&h=280
...
```

#### **Request**

```sh
curl --location --request POST 'https://warmup.api.cloudimage.com/warmup/urls' \
--header 'X-Client-Key: client_XXXXXXXXXXXXXXX' \
--form 'file=@url_list.csv'
```

`X-Client-Key` is the client's API key (can be found in Admin Console left menu : Settings / CDN Invalidation).

#### **Response**

```json
{
    "status": "success",
    "count_added": 4,
    "count_failed": 0,
    "msg": ""
}
```

### URL list in request body <a href="#od_5ff36124" id="od_5ff36124"></a>

#### **Request**

```sh
curl --location --request POST 'https://warmup.api.cloudimage.com/warmup/urls' \
--header 'X-Client-Key: client_XXXXXXXXXXXXXXX' \
--header 'Content-type: application/json' \
--data-raw '{"data": ["/sample.li/logo-cloudimg-black.png?w=200", "/sample.li/logo-cloudimg-white.png?w=200", "/sample.li/logo-cloudimg-yellow.png?w=200"]}'
```

`X-Client-Key` is the client's API key (can be found in Admin Console left menu : Settings / CDN Invalidation).

#### **Response**

```json
{
    "status": "success",
    "count_added": 4,
    "count_failed": 0,
    "msg": ""
}
```

## Getting warm-up status <a href="#od_c0abb965" id="od_c0abb965"></a>

You can check the status of the warm-up tasks for the last 5 days.

```
GET https://warmup.api.cloudimage.com/warmup/stats
```

#### Request <a href="#od_ccd0466f" id="od_ccd0466f"></a>

```sh
curl --location --request GET 'https://warmup.api.cloudimage.com/warmup/stats' \
--header 'X-Client-Key: client_XXXXXXXXXXXXXXX'
```

#### Response <a href="#od_da6d28df" id="od_da6d28df"></a>

```json
{
    "status": "success",
    "msg": "This is the status count of your requests for the last 5 days. The new requests appear as added and once the warmup is complete, they will increase the failed or the success counters",
    "stats": {
        "added": 9543,
        "success": 749,
        "failed": 12
     }
}
```


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.cloudimage.io/caching-and-acceleration/warmup-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
